summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2011-09-18 14:38:15 -0500
committerEugeni Dodonov <eugeni.dodonov@intel.com>2012-02-10 18:01:43 -0200
commit8766c6802d1f4aedb7dad26ee82bc5e97a145295 (patch)
tree3572f6035c105e2ff88b67b51badffc5e9f13dbf
parente81d9bf34d32c435f8600b8737d02980686a4e75 (diff)
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> Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
-rw-r--r--drivers/gpu/drm/drm_drv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index c5adf82f886..6e90095c5d8 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) {