| From f856567b930dfcdbc3323261bf77240ccdde01f5 Mon Sep 17 00:00:00 2001 |
| From: Dan Carpenter <dan.carpenter@oracle.com> |
| Date: Tue, 29 Oct 2013 22:11:06 +0300 |
| Subject: aacraid: missing capable() check in compat ioctl |
| |
| From: Dan Carpenter <dan.carpenter@oracle.com> |
| |
| 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| |
| --- |
| drivers/scsi/aacraid/linit.c | 2 ++ |
| 1 file changed, 2 insertions(+) |
| |
| --- a/drivers/scsi/aacraid/linit.c |
| +++ b/drivers/scsi/aacraid/linit.c |
| @@ -771,6 +771,8 @@ static long aac_compat_do_ioctl(struct a |
| 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); |
| } |
| |