]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
aacraid: fix security hole (CVE-2007-4308)
authorAlan Cox <alan@redhat.com>
Fri, 2 Nov 2007 02:41:27 +0000 (03:41 +0100)
committerAdrian Bunk <bunk@kernel.org>
Fri, 2 Nov 2007 02:41:27 +0000 (03:41 +0100)
On the SCSI layer ioctl path there is no implicit permissions check for
ioctls (and indeed other drivers implement unprivileged ioctls). aacraid
however allows all sorts of very admin only things to be done so should
check.

Signed-off-by: Alan Cox <alan@redhat.com>
Acked-by: Mark Salyzyn <mark_salyzyn@adaptec.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
drivers/scsi/aacraid/linit.c

index 2716178905625911a1364dd559b7f3907e1846a9..19a4579e35787e37779f164ada01a80fc9b7f7fc 100644 (file)
@@ -539,6 +539,8 @@ static int aac_cfg_open(struct inode *inode, struct file *file)
 static int aac_cfg_ioctl(struct inode *inode,  struct file *file,
                unsigned int cmd, unsigned long arg)
 {
+       if (!capable(CAP_SYS_ADMIN))
+               return -EPERM;
        return aac_do_ioctl(file->private_data, cmd, (void __user *)arg);
 }
 
@@ -592,6 +594,8 @@ static int aac_compat_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
 
 static long aac_compat_cfg_ioctl(struct file *file, unsigned cmd, unsigned long arg)
 {
+       if (!capable(CAP_SYS_ADMIN))
+               return -EPERM;
        return aac_compat_do_ioctl((struct aac_dev *)file->private_data, cmd, arg);
 }
 #endif