Bug 1362466 - (CVE-2016-6480) CVE-2016-6480 kernel: scsi: aacraid: double fetch in ioctl_send_fib()
CVE-2016-6480 kernel: scsi: aacraid: double fetch in ioctl_send_fib()
Status: NEW
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
impact=moderate,public=20160801,repor...
: Security
Depends On: 1362467 1369770 1369771 1369772 1369774 1369775
Blocks: 1362468
  Show dependency treegraph
 
Reported: 2016-08-02 05:37 EDT by Martin Prpič
Modified: 2017-03-21 09:10 EDT (History)
34 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
A race condition flaw was found in the ioctl_send_fib() function in the Linux kernel's aacraid implementation. A local attacker could use this flaw to cause a denial of service (out-of-bounds access or system crash) by changing a certain size value.
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martin Prpič 2016-08-02 05:37:09 EDT
The following flaw was found in the Linux kernel's aacraid driver:

I found this Double-Fetch bug in Linux-4.5/drivers/scsi/aacraid/commctrl.c when I was examining the source code.

In function ioctl_send_fib(), the driver fetches user space data by pointer arg via copy_from_user(), and this happens twice at line 81 and line 116 respectively. The first fetched value (stored in kfib) is used to get the header and calculate the size at line 90 so as to copy the whole message later at line 116, which means the copy size of the whole message is based on the old value that came from the first fetch. Besides, the whole message copied in the  second fetch also contains the header.

However, when the function processes the message after the second fetch at line 130, it uses kfib->header.Size that came from the second fetch, which might be different from the one came from the first fetch as well as calculated the size to copy the message from user space to driver.

If the kfib->header.Size is modified by a user thread under race condition between the fetch operations, for example changing to a very large value, this will lead to over-boundary access or other serious consequences in function aac_fib_send().

Upstream bug:

https://bugzilla.kernel.org/show_bug.cgi?id=116751

Accepted upstream fix:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=fa00c437eef8dc2e7b25f8cd868cfa405fcc2bb3

References:

http://seclists.org/bugtraq/2016/Aug/15

https://lkml.org/lkml/2016/4/26/1078 - discussion on lkml

https://www.spinics.net/lists/linux-scsi/msg98681.html - discussion 1

https://www.spinics.net/lists/linux-scsi/msg98745.html - discussion 2 + patch

https://www.spinics.net/lists/linux-scsi/msg98744.html - discussion 3 + patch v2
Comment 1 Martin Prpič 2016-08-02 05:37:50 EDT
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1362467]
Comment 7 Vladis Dronov 2016-08-24 08:10:33 EDT
Statement:

This issue affects the Linux kernel packages as shipped with Red Hat Enterprise Linux 5. This has been rated as having Moderate security impact and is not currently planned to be addressed in future updates. For additional information, refer to the Red Hat Enterprise Linux Life Cycle: https://access.redhat.com/support/policy/updates/errata/.

This issue affects the Linux kernel packages as shipped with Red Hat Enterprise Linux 6, 7 and Red Hat Enterprise MRG-2. Future Linux kernel updates for the respective releases might address this issue.
Comment 9 Fedora Update System 2016-09-02 16:51:05 EDT
kernel-4.7.2-201.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
Comment 10 Fedora Update System 2016-09-02 19:19:41 EDT
kernel-4.7.2-101.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
Comment 11 errata-xmlrpc 2016-11-03 13:21:15 EDT
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2016:2574 https://rhn.redhat.com/errata/RHSA-2016-2574.html
Comment 12 errata-xmlrpc 2016-11-03 15:56:27 EDT
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2016:2584 https://rhn.redhat.com/errata/RHSA-2016-2584.html
Comment 13 errata-xmlrpc 2016-11-03 17:37:59 EDT
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2016:2574 https://rhn.redhat.com/errata/RHSA-2016-2574.html
Comment 14 errata-xmlrpc 2016-11-03 17:45:06 EDT
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2016:2584 https://rhn.redhat.com/errata/RHSA-2016-2584.html
Comment 15 errata-xmlrpc 2017-03-21 09:10:27 EDT
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6

Via RHSA-2017:0817 https://rhn.redhat.com/errata/RHSA-2017-0817.html

Note You need to log in before you can comment on or make changes to this bug.