Bug 166329 - CVE-2005-2490 sendmsg compat stack overflow
Summary: CVE-2005-2490 sendmsg compat stack overflow
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel
Version: 3.0
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: David Miller
QA Contact: Brian Brock
URL:
Whiteboard: impact=important,reported=20050817,so...
Depends On:
Blocks: 156320
TreeView+ depends on / blocked
 
Reported: 2005-08-19 09:26 UTC by Mark J. Cox
Modified: 2007-11-30 22:07 UTC (History)
9 users (show)

Fixed In Version: RHSA-2005-663
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-09-28 15:35:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Test case for sendmsg() CMSG usage. (1.75 KB, text/x-csrc)
2005-09-05 06:35 UTC, David Miller
no flags Details
Fix for the fix, from David Woodhouse (6.09 KB, patch)
2005-09-05 06:37 UTC, David Miller
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2005:663 0 qe-ready SHIPPED_LIVE Important: Updated kernel packages available for Red Hat Enterprise Linux 3 Update 6 2005-09-28 04:00:00 UTC

Description Mark J. Cox 2005-08-19 09:26:09 UTC
+++ This bug was initially created as a clone of Bug #166248 +++

Al Viro reported a flaw in sendmsg(). "When we copy 32bit ->msg_control contents
to kernel, we walk the same userland data twice without sanity checks on the
second pass.  Moreover, if original looks small enough, we end up copying to
on-stack array."

This is a kernel buffer overflow and therefore could lead to privilege escalation.

This affects 2.6 head, and from brief inspection the code in linux 2.6.9 is
similar and therefore RHEL4 is affected.

Marking as embargoed for now, needs reporting to vendor-sec and kernel@security
soon.

Comment 2 Mark J. Cox 2005-08-19 09:36:47 UTC
arch/ppc64/kernel/sys_ppc32.c
arch/x86_64/ia32/socket32.c
arch/s390x/kernel/linux32.c
not ia64 from what I can see in 2.4.21

Therefore this may affect RHEL3 for ppc64, x86_64 and s390x

Comment 3 Mark J. Cox 2005-08-31 09:43:05 UTC
Notified security, vendor-sec. 
Embargo set for one week, 20050907:12

Comment 4 Ernie Petrides 2005-09-02 19:20:58 UTC
A fix for this problem has just been committed to the RHEL3 U6
patch pool this afternoon (in kernel version 2.4.21-36.EL).


Comment 5 David Miller 2005-09-02 20:19:16 UTC
We need very strongly to test this change.  As per bugzilla #166248
the RHEL4 version of the fix, which I merely backported into the RHEL3
U6 tree, breaks portmap on ppc64.


Comment 6 Ernie Petrides 2005-09-03 00:10:30 UTC
This fix is now known to cause a regression with unaligned CMSG data areas,
and thus will need to be revised.  Changing bug state to FAILS_QA.


Comment 7 David Miller 2005-09-05 06:35:55 UTC
Created attachment 118446 [details]
Test case for sendmsg() CMSG usage.

This is a test program which specifically tests the code path
being modified by this bug fix.  Since this code path is used only
for 32-bit applications running under a 64-bit kernel, make sure
that the test program is compiled into a 32-bit binary for proper
testing.

Comment 8 David Miller 2005-09-05 06:37:25 UTC
Created attachment 118447 [details]
Fix for the fix, from David Woodhouse

Relative patch, against RHEL3 U6, which fixes the bug fix properly.

Comment 9 Ernie Petrides 2005-09-07 17:25:24 UTC
A fix for the regression has just been committed to the RHEL3 U6
patch pool this afternoon (in kernel version 2.4.21-37.EL).

Mark, the embargo has now been lifted, right?


Comment 10 Mark J. Cox 2005-09-07 17:31:03 UTC
Yes, the embargo is lifted, however this issue isn't yet public, and I won't
open up the bugs until such time as it gets commited upstream or public by
another vendor.

Comment 13 Mark J. Cox 2005-09-08 09:17:27 UTC
Public today by commit to stable-queue.git, removing embargo

Comment 15 Red Hat Bugzilla 2005-09-28 15:35:26 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2005-663.html



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