DescriptionEugene Teo (Security Response)
2010-10-21 03:52:21 UTC
Description of problem:
The CONFIG_STACK_GROWSDOWN variant of setup_arg_pages() does not check the size of the argument/environment area on the stack. When it is unworkably large, shift_arg_pages() hits its BUG_ON. This is exploitable with a very large RLIMIT_STACK limit, to create a crash pretty easily.
Check that the initial stack is not too large to make it possible to map in any executable. We're not checking that the actual executable (or intepreter, for binfmt_elf) will fit. So those mappings might clobber part of the initial stack mapping. But that is just userland lossage that userland made happen, not a kernel problem.
Upstream commit:
http://git.kernel.org/linus/1b528181b2ffa14721fb28ad1bd539fe1732c583
Reference:
http://grsecurity.net/~spender/64bit_dos.c
Acknowledgements:
Red Hat would like to thank Brad Spengler for reporting this issue.
Comment 4Eugene Teo (Security Response)
2011-01-27 06:55:23 UTC
Statement:
This issue did not affect the versions of Linux kernel as shipped with Red Hat
Enterprise Linux 4 as they did not backport the upstream commit b6a2fea3 that introduced the issue. This was addressed in Red Hat Enterprise Linux 5 and Red Hat Enterprise MRG via https://rhn.redhat.com/errata/RHSA-2011-0004.html and
https://rhn.redhat.com/errata/RHSA-2010-0958.html. Future kernel updates in Red Hat Enterprise Linux 6 may address this flaw.