diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-10-29 22:11:06 +0300 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2013-11-28 14:02:06 +0000 |
commit | a88f5ccd2ac9798c046609a8aec18c3f522a6334 (patch) | |
tree | deaa52e4ccdce318d0ec1dc5071174f8a91acc31 | |
parent | 02c54b6cf2b7bd1089bef485d7a81bdf0c5999d8 (diff) |
aacraid: missing capable() check in compat ioctl
commit f856567b930dfcdbc3323261bf77240ccdde01f5 upstream.
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | drivers/scsi/aacraid/linit.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 705e13e470a..2e658d24db4 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -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); } |