Skip to content

Commit

Permalink
drm: use drms ioctl cmd not what we get passed from userspace.
Browse files Browse the repository at this point in the history
This enforces us to use the drm ioctl types so read/write works correctly and not believe
what userspace tells us.

It does this hopefully without breaking the drm api.

Fixes bug from thread: BUG: unable to handle kernel NULL pointer dereference (drm_getunique)

Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Johannes Weiner authored and Dave Airlie committed Jun 13, 2008
1 parent 5dd3457 commit 41ee2ff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/char/drm/drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ int drm_ioctl(struct inode *inode, struct file *filp,
else
goto err_i1;

/* Do not trust userspace, use our own definition */
cmd = ioctl->cmd;
func = ioctl->func;
/* is there a local override? */
if ((nr == DRM_IOCTL_NR(DRM_IOCTL_DMA)) && dev->driver->dma_ioctl)
Expand Down

0 comments on commit 41ee2ff

Please sign in to comment.