Bug 160200 - CAN-2005-1768 64bit execve() race leads to buffer overflow
CAN-2005-1768 64bit execve() race leads to buffer overflow
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: kernel (Show other bugs)
2.1
ia64 Linux
medium Severity high
: ---
: ---
Assigned To: Don Howard
Brian Brock
source=secalert,reported=20050612,imp...
: Security
Depends On:
Blocks: 143573
  Show dependency treegraph
 
Reported: 2005-06-13 06:48 EDT by Mark J. Cox (Product Security)
Modified: 2007-11-30 17:06 EST (History)
1 user (show)

See Also:
Fixed In Version: RHSA-2005-551
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-08-25 09:18:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Proposed patch from Andi Kleen (2.45 KB, patch)
2005-06-13 06:48 EDT, Mark J. Cox (Product Security)
no flags Details | Diff

  None (edit)
Description Mark J. Cox (Product Security) 2005-06-13 06:48:19 EDT
Reported to secalert@redhat.com by Ilja van Sprundel, a race condition in execve
affecting x86_64 and ia64 which exists because kmalloc() or get_user() can
block, and hence another thread can change the argv and envp pointers, causing a
bufferoverflow (also on SMP without blocking)

          na = nargs(argv, NULL);
 ...      ne = nargs(envp, NULL);
 ...      len = (na + ne + 2) * sizeof(*av);
 ...      av = kmalloc(len, GFP_KERNEL);
 ...      r = nargs(argv, av);
 ...      r = nargs(envp, ae);

"the nargs() function is used to first count the amount of argv and
envp pointers, next a kmalloc() is done, and then nargs() is called again to
copy the argv and envp pointer into this newly allocated memory.        the race
condition exists because kmalloc() or get_user() can block, and hence another
thread can change the argv and envp pointers, causing a buffer overflow."

Currently embargoed
Comment 1 Mark J. Cox (Product Security) 2005-06-13 06:48:20 EDT
Created attachment 115348 [details]
Proposed patch from Andi Kleen
Comment 5 Mark J. Cox (Product Security) 2005-07-07 18:13:24 EDT
Fixed in 2.4.32-pre1, therefore no need to treat as embargoed.
Comment 6 Mark J. Cox (Product Security) 2005-07-08 05:14:38 EDT
Public 20050704
Comment 11 Red Hat Bugzilla 2005-08-25 09:18:56 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.

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

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