Skip to content

Commit f856567

Browse files
Dan Carpentertorvalds
Dan Carpenter
authored andcommitted
aacraid: missing capable() check in compat ioctl
In commit d496f94 ('[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 <[email protected]> Cc: [email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent c2c65cd commit f856567

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/scsi/aacraid/linit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ static long aac_compat_do_ioctl(struct aac_dev *dev, unsigned cmd, unsigned long
771771
static int aac_compat_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
772772
{
773773
struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata;
774+
if (!capable(CAP_SYS_RAWIO))
775+
return -EPERM;
774776
return aac_compat_do_ioctl(dev, cmd, (unsigned long)arg);
775777
}
776778

0 commit comments

Comments
 (0)