+++ 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.
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
Notified security, vendor-sec. Embargo set for one week, 20050907:12
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).
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.
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.
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.
Created attachment 118447 [details] Fix for the fix, from David Woodhouse Relative patch, against RHEL3 U6, which fixes the bug fix properly.
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?
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.
Public today by commit to stable-queue.git, removing embargo
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