Skip to content

Commit

Permalink
drm: drm_ioctl() should zero-init extra data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rob Clark authored and Dave Airlie committed Oct 19, 2011
1 parent 017ed80 commit dd2351d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit dd2351d

Please sign in to comment.