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
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.
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.
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
(In reply to comment #4) > http://seclists.org/oss-sec/2010/q4/136 > http://seclists.org/oss-sec/2010/q4/137 http://seclists.org/oss-sec/2010/q4/138
This has been assigned the name CVE-2010-4157.
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
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
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