OpenCloudOS-Kernel/drivers/gpu/drm/vmwgfx
Dave Airlie 1b2f148963 drm: block userspace under allocating buffer and having drivers overwrite it (v2)
With the current screwed but its ABI, ioctls for the drm, Linus pointed out that we could allow userspace to specify the allocation size, but we pass it to the driver which then uses it blindly to store a struct. Now if userspace specifies the allocation size as smaller than the driver needs, the driver can possibly overwrite memory.

This patch restructures the driver ioctls so we store the structure size we are expecting, and make sure we allocate at least that size. The copy from/to userspace are still restricted to the size the user specifies, this allows ioctl structs to grow on both sides of the equation.

Up until now we didn't really use the DRM_IOCTL defines in the kernel, so this cleans them up and adds them for nouveau.

v2:
fix nouveau pushbuf arg (thanks to Ben for pointing it out)

Reported-by: Linus Torvalds <torvalds@linuxfoundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-17 14:52:25 +10:00
..
Kconfig drm/vmwgfx: depends on FB 2010-03-15 10:35:04 +10:00
Makefile drm/vmwgfx: Add kernel throttling support. Bump minor. 2010-06-01 09:37:15 +10:00
svga3d_reg.h
svga_escape.h
svga_overlay.h
svga_reg.h
svga_types.h
vmwgfx_buffer.c drm/ttm: remove io_ field from TTM V6 2010-04-20 14:13:09 +10:00
vmwgfx_drv.c drm: block userspace under allocating buffer and having drivers overwrite it (v2) 2010-08-17 14:52:25 +10:00
vmwgfx_drv.h drm: move ttm global code to core drm 2010-08-04 09:46:06 +10:00
vmwgfx_execbuf.c drm/vmwgfx: return -EFAULT for copy_to_user errors 2010-06-08 09:33:41 +10:00
vmwgfx_fb.c drm/vmgfx: operation on ‘par->dirty.y1’ may be undefined 2010-08-02 10:12:21 +10:00
vmwgfx_fence.c drm/vmwgfx: Add kernel throttling support. Bump minor. 2010-06-01 09:37:15 +10:00
vmwgfx_fifo.c drm/vmwgfx: Support older hardware. 2010-06-01 09:37:25 +10:00
vmwgfx_gmr.c drm/vmwgfx: Add DRM driver for VMware Virtual GPU 2009-12-15 08:38:43 +10:00
vmwgfx_ioctl.c drm/vmwgfx: Update the user-space interface. 2010-02-11 11:58:09 +10:00
vmwgfx_irq.c drm/vmwgfx: Add kernel throttling support. Bump minor. 2010-06-01 09:37:15 +10:00
vmwgfx_kms.c drm: Propagate error code from fb_create() 2010-08-10 10:46:51 +10:00
vmwgfx_kms.h drm/vmwgfx: Allow userspace to change default layout. Bump minor. 2010-06-03 13:13:36 +10:00
vmwgfx_ldu.c drm: expand gamma_set 2010-08-10 10:47:00 +10:00
vmwgfx_overlay.c drm/vmwgfx: Unpause overlay on update. 2010-06-01 09:37:47 +10:00
vmwgfx_reg.h drm/vmwgfx: Add DRM driver for VMware Virtual GPU 2009-12-15 08:38:43 +10:00
vmwgfx_resource.c drm/vmwgfx: return -EFAULT for copy_to_user errors 2010-06-08 09:33:41 +10:00
vmwgfx_ttm_glue.c drm: move ttm global code to core drm 2010-08-04 09:46:06 +10:00