Bug 651147 - (CVE-2010-4157) CVE-2010-4157 kernel: gdth: integer overflow in ioc_general()
CVE-2010-4157 kernel: gdth: integer overflow in ioc_general()
Status: NEW
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
: Security
Depends On: 651172 651173 651174 651175 651176
  Show dependency treegraph
Reported: 2010-11-08 16:43 EST by Petr Matousek
Modified: 2016-03-04 06:35 EST (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Petr Matousek 2010-11-08 16:43:20 EST
Description of problem:
gdth_ioctl_alloc() takes the size variable as an int. copy_from_user() takes the size variable as an unsigned long. gen.data_len and gen.sense_len are unsigned longs. On x86_64 longs are 64 bit and ints are 32 bit.

We could pass in a very large number and the allocation would truncate the size to 32 bits and allocate a small buffer.  Then when we do the copy_from_user(), it would result in a memory corruption.


Comment 1 Petr Matousek 2010-11-08 17:14:37 EST
Affects only 64 bit installations with GDT ISA/EISA/PCI Disk Array Controllers as the driver scans buses for aforementioned devices before creating /dev/gdth which the affected IOCTL is to be called against. Also, /dev/gdth has to be accessible for non-root users.
Comment 2 Petr Matousek 2010-11-08 17:17:35 EST

The Linux kernel as shipped with Red Hat Enterprise Linux 3 did not include the vulnerable code, and therefore is not affected by this issue. Future kernel updates in Red Hat Enterprise Linux 4, 5 and Red Hat Enterprise MRG may address this flaw.
Comment 4 Kurt Seifried 2010-11-08 20:40:38 EST

From: Dan Rosenberg <dan.j.rosenberg () gmail com>
Date: Mon, 8 Nov 2010 19:47:29 -0500

This is not actually a security issue.  See the code:

if (!(buf = gdth_ioctl_alloc(ha, gen.data_len + gen.sense_len,
                                     FALSE, &paddr)))
            return -EFAULT;
if (copy_from_user(buf, arg + sizeof(gdth_ioctl_general),
                           gen.data_len + gen.sense_len)) {

If gen.data_len + gen.sense_len > UINT_MAX, then a small buffer will
be allocated.  But then the copy_from_user() will always fault before
copying any data over because the access_ok() check will fail on sizes
Comment 6 Vincent Danen 2010-11-10 16:50:26 EST
This has been assigned the name CVE-2010-4157.
Comment 7 errata-xmlrpc 2010-12-08 14:09:33 EST
This issue has been addressed in following products:

  MRG for RHEL-5

Via RHSA-2010:0958 https://rhn.redhat.com/errata/RHSA-2010-0958.html
Comment 8 errata-xmlrpc 2011-01-04 11:52:58 EST
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2011:0004 https://rhn.redhat.com/errata/RHSA-2011-0004.html
Comment 9 errata-xmlrpc 2011-01-18 12:45:22 EST
This issue has been addressed in following products:

  Red Hat Enterprise Linux 4

Via RHSA-2011:0162 https://rhn.redhat.com/errata/RHSA-2011-0162.html

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