Red Hat Bugzilla – Bug 160200
CAN-2005-1768 64bit execve() race leads to buffer overflow
Last modified: 2007-11-30 17:06:54 EST
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
Created attachment 115348 [details] Proposed patch from Andi Kleen
Fixed in 2.4.32-pre1, therefore no need to treat as embargoed.
Public 20050704
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