aacraid: missing capable() check in compat ioctl
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 29 Oct 2013 19:11:06 +0000 (22:11 +0300)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 30 Oct 2013 19:24:49 +0000 (12:24 -0700)
In commit d496f94d22d1 ('[SCSI] aacraid: fix security weakness') we
added a check on CAP_SYS_RAWIO to the ioctl.  The compat ioctls need the
check as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/scsi/aacraid/linit.c

index 408a42ef787a32b6d8fece98c717376ce93c1270..f0d432c139d0cecedf51295562c858d22a9f44f0 100644 (file)
@@ -771,6 +771,8 @@ static long aac_compat_do_ioctl(struct aac_dev *dev, unsigned cmd, unsigned long
 static int aac_compat_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
 {
        struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata;
+       if (!capable(CAP_SYS_RAWIO))
+               return -EPERM;
        return aac_compat_do_ioctl(dev, cmd, (unsigned long)arg);
 }