diff options
author | Dave Airlie <airlied@redhat.com> | 2008-06-20 07:42:38 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2008-06-20 07:42:38 +0200 |
commit | 858a3685bcf3ac199128e4aa85eaae2fb9d191b5 (patch) | |
tree | abfe40eca6567faba5807b44483a01311d634f5d /drivers/char/drm/drm_drv.c | |
parent | drm/i915: add support for Intel series 4 chipsets. (diff) | |
download | linux-858a3685bcf3ac199128e4aa85eaae2fb9d191b5.tar.xz linux-858a3685bcf3ac199128e4aa85eaae2fb9d191b5.zip |
drm: only trust core drm ioctls - driver ioctls are a mess.
So driver ioctls need a full auditing before we can make this change.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/char/drm/drm_drv.c')
-rw-r--r-- | drivers/char/drm/drm_drv.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c index 22957ac15df4..564138714bb5 100644 --- a/drivers/char/drm/drm_drv.c +++ b/drivers/char/drm/drm_drv.c @@ -470,19 +470,18 @@ int drm_ioctl(struct inode *inode, struct file *filp, if ((nr >= DRM_COMMAND_BASE) && (nr < DRM_COMMAND_END) && (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls)) ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE]; - else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE)) + else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE)) { ioctl = &drm_ioctls[nr]; - else + cmd = ioctl->cmd; + } 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) func = dev->driver->dma_ioctl; - if (!func) { DRM_DEBUG("no function\n"); retcode = -EINVAL; |