Bug 166329 - CVE-2005-2490 sendmsg compat stack overflow
CVE-2005-2490 sendmsg compat stack overflow
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: David Miller
Brian Brock
: Security
Depends On:
Blocks: 156320
  Show dependency treegraph
Reported: 2005-08-19 05:26 EDT by Mark J. Cox (Product Security)
Modified: 2007-11-30 17:07 EST (History)
9 users (show)

See Also:
Fixed In Version: RHSA-2005-663
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-28 11:35:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Mark J. Cox (Product Security) 2005-08-19 05:26:09 EDT
+++ 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
Comment 2 Mark J. Cox (Product Security) 2005-08-19 05:36:47 EDT
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 (Product Security) 2005-08-31 05:43:05 EDT
Notified security@kernel.org, vendor-sec. 
Embargo set for one week, 20050907:12
Comment 4 Ernie Petrides 2005-09-02 15:20:58 EDT
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 16:19:16 EDT
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-02 20:10:30 EDT
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 02:35:55 EDT
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
Comment 8 David Miller 2005-09-05 02:37:25 EDT
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 13:25:24 EDT
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 (Product Security) 2005-09-07 13:31:03 EDT
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 (Product Security) 2005-09-08 05:17:27 EDT
Public today by commit to stable-queue.git, removing embargo
Comment 15 Red Hat Bugzilla 2005-09-28 11:35:26 EDT
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.


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