Skip to content

Commit

Permalink
drm/qxl: add missing access check for execbuffer ioctl
Browse files Browse the repository at this point in the history
Reported-by: Mathieu Desnoyers <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
  • Loading branch information
airlied committed Jun 28, 2013
1 parent 426729d commit 18097b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/qxl/qxl_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ static int qxl_execbuffer_ioctl(struct drm_device *dev, void *data,
if (user_cmd.command_size > PAGE_SIZE - sizeof(union qxl_release_info))
return -EINVAL;

if (!access_ok(VERIFY_READ,
(void *)(unsigned long)user_cmd.command,
user_cmd.command_size))
return -EFAULT;

ret = qxl_alloc_release_reserved(qdev,
sizeof(union qxl_release_info) +
user_cmd.command_size,
Expand Down

0 comments on commit 18097b9

Please sign in to comment.