Bug 1362466 (CVE-2016-6480) - CVE-2016-6480 kernel: scsi: aacraid: double fetch in ioctl_send_fib()
Summary: CVE-2016-6480 kernel: scsi: aacraid: double fetch in ioctl_send_fib()
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2016-6480
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1362467 1369770 1369771 1369772 1369774 1369775
Blocks: 1362468
TreeView+ depends on / blocked
 
Reported: 2016-08-02 09:37 UTC by Martin Prpič
Modified: 2021-02-17 03:29 UTC (History)
30 users (show)

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.
Clone Of:
Environment:
Last Closed: 2019-06-08 02:57:09 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2574 0 normal SHIPPED_LIVE Important: kernel security, bug fix, and enhancement update 2016-11-03 12:06:10 UTC
Red Hat Product Errata RHSA-2016:2584 0 normal SHIPPED_LIVE Important: kernel-rt security, bug fix, and enhancement update 2016-11-03 12:08:49 UTC
Red Hat Product Errata RHSA-2017:0817 0 normal SHIPPED_LIVE Moderate: kernel security, bug fix, and enhancement update 2017-03-21 13:06:51 UTC

Description Martin Prpič 2016-08-02 09:37:09 UTC
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 09:37:50 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1362467]

Comment 7 Vladis Dronov 2016-08-24 12:10:33 UTC
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 20:51:05 UTC
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 23:19:41 UTC
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 17:21:15 UTC
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 19:56:27 UTC
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 21:37:59 UTC
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 21:45:06 UTC
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 13:10:27 UTC
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.