diff options
author | Rob Clark <rob@ti.com> | 2011-09-18 23:38:15 +0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-10-19 17:46:45 +0400 |
commit | dd2351da7c438eb3d5f64a161cf3483648725dcd (patch) | |
tree | 9ecd9d07b76ce0960188e54fa44baf1b6de2dcd8 /drivers/gpu/drm/drm_drv.c | |
parent | 017ed8012e74ca15748863f45d2c078453026a0a (diff) | |
download | linux-dd2351da7c438eb3d5f64a161cf3483648725dcd.tar.xz |
drm: drm_ioctl() should zero-init extra data
If an older userspace passes in a smaller arg than the current kernel
ioctl arg struct, then extra fields should be initialized to zero
rather than passing random data to the DRM driver.
Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_drv.c')
-rw-r--r-- | drivers/gpu/drm/drm_drv.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 93a112d45c1a..7a87e0878f30 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -438,6 +438,8 @@ long drm_ioctl(struct file *filp, goto err_i1; } } + if (asize > usize) + memset(kdata + usize, 0, asize - usize); } if (cmd & IOC_IN) { |