Bug 651147 (CVE-2010-4157) - CVE-2010-4157 kernel: gdth: integer overflow in ioc_general()
Summary: CVE-2010-4157 kernel: gdth: integer overflow in ioc_general()
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2010-4157
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 651172 651173 651174 651175 651176
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-08 21:43 UTC by Petr Matousek
Modified: 2021-10-19 09:16 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-19 09:16:27 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2010:0958 0 normal SHIPPED_LIVE Important: kernel-rt security and bug fix update 2010-12-08 19:08:55 UTC
Red Hat Product Errata RHSA-2011:0004 0 normal SHIPPED_LIVE Important: kernel security, bug fix, and enhancement update 2011-01-04 16:52:05 UTC
Red Hat Product Errata RHSA-2011:0162 0 normal SHIPPED_LIVE Important: kernel security and bug fix update 2011-01-18 17:45:00 UTC

Description Petr Matousek 2010-11-08 21:43:20 UTC
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.

Reference:
http://ns3.spinics.net/lists/linux-scsi/msg47361.html

Upstream:
http://git.kernel.org/linus/f63ae56e4e97fb12053590e41a4fa59e7daa74a4

Comment 1 Petr Matousek 2010-11-08 22:14:37 UTC
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 22:17:35 UTC
Statement:

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-09 01:40:38 UTC
http://seclists.org/oss-sec/2010/q4/136

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 21:50:26 UTC
This has been assigned the name CVE-2010-4157.

Comment 7 errata-xmlrpc 2010-12-08 19:09:33 UTC
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 16:52:58 UTC
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 17:45:22 UTC
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.