[linux] 02/02: aacraid: Check size values after double-fetch from user (CVE-2016-6480)
debian-kernel at lists.debian.org
debian-kernel at lists.debian.org
Sat Aug 27 22:27:27 UTC 2016
This is an automated email from the git hooks/post-receive script.
benh pushed a commit to branch master
in repository linux.
commit 2c76695c24cdd1a48325abe3c61db4cf826a298f
Author: Ben Hutchings <ben at decadent.org.uk>
Date: Sat Aug 27 23:17:17 2016 +0100
aacraid: Check size values after double-fetch from user (CVE-2016-6480)
---
debian/changelog | 1 +
...ck-size-values-after-double-fetch-from-us.patch | 62 ++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 64 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 325bc11..88e77fc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -41,6 +41,7 @@ linux (4.7.2-1) UNRELEASED; urgency=medium
- Add kernel config option to set securelevel when in Secure Boot mode
- Enable EFI_SECURE_BOOT_SECURELEVEL
* tcp: fix use after free in tcp_xmit_retransmit_queue() (CVE-2016-6828)
+ * aacraid: Check size values after double-fetch from user (CVE-2016-6480)
[ Martin Michlmayr ]
* [armhf] Enable MMC_SDHCI_IPROC and HW_RANDOM_BCM2835 for BCM2835.
diff --git a/debian/patches/bugfix/all/aacraid-check-size-values-after-double-fetch-from-us.patch b/debian/patches/bugfix/all/aacraid-check-size-values-after-double-fetch-from-us.patch
new file mode 100644
index 0000000..d07f5fa
--- /dev/null
+++ b/debian/patches/bugfix/all/aacraid-check-size-values-after-double-fetch-from-us.patch
@@ -0,0 +1,62 @@
+From: Dave Carroll <david.carroll at microsemi.com>
+Date: Fri, 5 Aug 2016 13:44:10 -0600
+Subject: aacraid: Check size values after double-fetch from user
+Origin: https://git.kernel.org/linus/fa00c437eef8dc2e7b25f8cd868cfa405fcc2bb3
+
+In aacraid's ioctl_send_fib() we do two fetches from userspace, one the
+get the fib header's size and one for the fib itself. Later we use the
+size field from the second fetch to further process the fib. If for some
+reason the size from the second fetch is different than from the first
+fix, we may encounter an out-of- bounds access in aac_fib_send(). We
+also check the sender size to insure it is not out of bounds. This was
+reported in https://bugzilla.kernel.org/show_bug.cgi?id=116751 and was
+assigned CVE-2016-6480.
+
+Reported-by: Pengfei Wang <wpengfeinudt at gmail.com>
+Fixes: 7c00ffa31 '[SCSI] 2.6 aacraid: Variable FIB size (updated patch)'
+Cc: stable at vger.kernel.org
+Signed-off-by: Dave Carroll <david.carroll at microsemi.com>
+Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>
+Signed-off-by: Martin K. Petersen <martin.petersen at oracle.com>
+---
+ drivers/scsi/aacraid/commctrl.c | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
+index b381b3718a98..5648b715fed9 100644
+--- a/drivers/scsi/aacraid/commctrl.c
++++ b/drivers/scsi/aacraid/commctrl.c
+@@ -63,7 +63,7 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
+ struct fib *fibptr;
+ struct hw_fib * hw_fib = (struct hw_fib *)0;
+ dma_addr_t hw_fib_pa = (dma_addr_t)0LL;
+- unsigned size;
++ unsigned int size, osize;
+ int retval;
+
+ if (dev->in_reset) {
+@@ -87,7 +87,8 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
+ * will not overrun the buffer when we copy the memory. Return
+ * an error if we would.
+ */
+- size = le16_to_cpu(kfib->header.Size) + sizeof(struct aac_fibhdr);
++ osize = size = le16_to_cpu(kfib->header.Size) +
++ sizeof(struct aac_fibhdr);
+ if (size < le16_to_cpu(kfib->header.SenderSize))
+ size = le16_to_cpu(kfib->header.SenderSize);
+ if (size > dev->max_fib_size) {
+@@ -118,6 +119,14 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
+ goto cleanup;
+ }
+
++ /* Sanity check the second copy */
++ if ((osize != le16_to_cpu(kfib->header.Size) +
++ sizeof(struct aac_fibhdr))
++ || (size < le16_to_cpu(kfib->header.SenderSize))) {
++ retval = -EINVAL;
++ goto cleanup;
++ }
++
+ if (kfib->header.Command == cpu_to_le16(TakeABreakPt)) {
+ aac_adapter_interrupt(dev);
+ /*
diff --git a/debian/patches/series b/debian/patches/series
index 9cb3ba4..4aa5037 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -112,6 +112,7 @@ features/all/securelevel/arm64-add-kernel-config-option-to-set-securelevel-wh.pa
bugfix/all/ptrace-being-capable-wrt-a-process-requires-mapped-uids-gids.patch
debian/i386-686-pae-pci-set-pci-nobios-by-default.patch
bugfix/all/tcp-fix-use-after-free-in-tcp_xmit_retransmit_queue.patch
+bugfix/all/aacraid-check-size-values-after-double-fetch-from-us.patch
# ABI maintenance
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git
More information about the Kernel-svn-changes
mailing list