Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1589324 - (CVE-2018-1000204) CVE-2018-1000204 kernel: Infoleak caused by incorrect handling of the SG_IO ioctl
CVE-2018-1000204 kernel: Infoleak caused by incorrect handling of the SG_IO i...
Status: NEW
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
low Severity low
: ---
: ---
Assigned To: Red Hat Product Security
impact=low,public=20180518,reported=2...
: Security
Depends On: 1589688 1592371
Blocks: 1589326
  Show dependency treegraph
 
Reported: 2018-06-08 13:12 EDT by Pedro Sampaio
Modified: 2018-10-30 05:02 EDT (History)
45 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
A malformed SG_IO ioctl issued for a SCSI device in the Linux kernel leads to a local kernel data leak manifesting in up to approximately 1000 memory pages copied to the userspace. The problem has limited scope as non-privileged users usually have no permissions to access SCSI device files.
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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:2948 None None None 2018-10-30 05:02 EDT

  None (edit)
Description Pedro Sampaio 2018-06-08 13:12:29 EDT
A malformed SG_IO ioctl issued for a SCSI device in the Linux kernel leads to a local kernel data leak manifesting in up to approx. 1000 memory pages copied to the userspace. The problem has limited scope, as non-privileged users usually have no permissions to access SCSI device files.

References:

http://seclists.org/oss-sec/2018/q2/168

An upstream patch:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a45b599ad808c3c982fdcdc12b0b8611c2f92824

https://marc.info/?l=linux-scsi&m=152933023515279&w=2 (suggested but not approved at the time of this writing)
Comment 2 Adam Mariš 2018-06-11 04:03:43 EDT
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1589688]
Comment 3 Justin M. Forbes 2018-06-11 09:16:22 EDT
This was fixed for Fedora with the 4.16.12 stable updates.
Comment 7 Jeff Moyer 2018-06-18 09:59:31 EDT
(In reply to Pedro Sampaio from comment #0)
> A malformed SG_IO ioctl issued for a SCSI device in the Linux kernel leads
> to a local kernel data leak manifesting in up to approx. 1000 memory pages
> copied to the userspace. The problem has limited scope, as non-privileged
> users usually have no permissions to access SCSI device files.
        ^^^^^^^

The allocation will be zeroed if the user doesn't have the right capabilities:

       if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO))
               gfp_mask |= __GFP_ZERO;

The justification for this as a security issue was that documentation guided users to chmod the sg device to be world writeable.  That isn't enough to cause a data leak.

I'd say this is not a security issue at all.  If you have CAP_SYS_ADMIN or CAP_SYS_RAWIO, it's game over already.

> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/
> ?id=a45b599ad808c3c982fdcdc12b0b8611c2f92824

And this patch was poorly done, IMO.  Here's the follow-up I sent upstream:
  https://marc.info/?l=linux-scsi&m=152933023515279&w=2
Comment 9 Vladis Dronov 2018-06-22 10:58:38 EDT
(In reply to Jeff Moyer from comment #7)
> The justification for this as a security issue was that documentation guided
> users to chmod the sg device to be world writeable.  That isn't enough to
> cause a data leak.

Indeed, thank you Jeff for mentioning this. So a data leak is possible only when a user is granted CAP_SYS_ADMIN or CAP_SYS_RAWIO (not in the namespaces) and it is not root. Which makes an attack surface and a security impact quite small. We are going to adjust a security impact of this flaw to Low.
Comment 10 errata-xmlrpc 2018-10-30 05:01:54 EDT
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2018:2948 https://access.redhat.com/errata/RHSA-2018:2948

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