]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vmwgfx: Protect from excessive execbuf kernel memory allocations v3
authorThomas Hellstrom <thellstrom@vmware.com>
Wed, 12 Dec 2018 10:52:08 +0000 (11:52 +0100)
committerThomas Hellstrom <thellstrom@vmware.com>
Thu, 13 Dec 2018 12:04:25 +0000 (13:04 +0100)
commit9cc587c3f43d3e1d22789756ba480ec7e42fa7d8
tree110744e9652bfbc00018fa572add924df2ca7ee0
parent6e1e892811d986371d3c71cbc1a513aad0b3d7ff
drm/vmwgfx: Protect from excessive execbuf kernel memory allocations v3

With the new validation code, a malicious user-space app could
potentially submit command streams with enough buffer-object and resource
references in them to have the resulting allocated validion nodes and
relocations make the kernel run out of GFP_KERNEL memory.

Protect from this by having the validation code reserve TTM graphics
memory when allocating.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Deepak Rawat <drawat@vmware.com>
---
v2: Removed leftover debug printouts
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
drivers/gpu/drm/vmwgfx/vmwgfx_validation.c
drivers/gpu/drm/vmwgfx/vmwgfx_validation.h