From 6b520005c6714d8a8afa68b8a43065a40da298cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 3 Jun 2008 11:27:39 +0200 Subject: Revert "don't copy back if an error was returned." This reverts commit 6671ad1917698b6174a1af314b63b3800d75248c. The vblank ioctl needs to update the userspace parameters when interrupted by a signal, which was prevented by this. Let's see if this breaks other ioctls... --- linux-core/drm_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core/drm_drv.c') diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index b8b8333e..609fc838 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -655,7 +655,7 @@ long drm_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) retcode = func(dev, kdata, file_priv); } - if ((retcode == 0) && (cmd & IOC_OUT)) { + if (cmd & IOC_OUT) { if (copy_to_user((void __user *)arg, kdata, _IOC_SIZE(cmd)) != 0) retcode = -EACCES; -- cgit v1.2.3 From 8712f0a17bb135d4ad3eb85b30f47c561cf9c148 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 20 Jun 2008 12:03:41 +1000 Subject: drm: fix the ioctl to not believe userspace. believing userspace causes oopses --- linux-core/drm_drv.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux-core/drm_drv.c') diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index 609fc838..b375fa1b 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -631,6 +631,8 @@ long drm_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) goto err_i1; } #endif + cmd = ioctl->cmd; + func = ioctl->func; /* is there a local override? */ if ((nr == DRM_IOCTL_NR(DRM_IOCTL_DMA)) && dev->driver->dma_ioctl) -- cgit v1.2.3 From 1915de2c56d71bbd04a7c085cbd35fbe8e33af9d Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 20 Jun 2008 15:35:47 +1000 Subject: drm: only use kernel ioctl cmd when doing a core ioctl. Need to overhaul the mess that is driver ioctls --- linux-core/drm_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'linux-core/drm_drv.c') diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index b375fa1b..6ac2adf3 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -613,9 +613,10 @@ long drm_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 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 { retcode = -EINVAL; goto err_i1; } @@ -631,7 +632,6 @@ long drm_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) goto err_i1; } #endif - cmd = ioctl->cmd; func = ioctl->func; /* is there a local override? */ -- cgit v1.2.3