diff options
author | Michael Neuling <[email protected]> | 2010-02-10 13:56:42 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2010-02-11 13:59:43 -0800 |
commit | 803bf5ec259941936262d10ecc84511b76a20921 (patch) | |
tree | ed159cfdf254f6b139ffc6b4a1e8437c6362b474 /net/lapb/lapb_in.c | |
parent | 4cfbafd33f5ae99688ab82525a1d449c1c1b198f (diff) |
fs/exec.c: restrict initial stack space expansion to rlimit
When reserving stack space for a new process, make sure we're not
attempting to expand the stack by more than rlimit allows.
This fixes a bug caused by b6a2fea39318e43fee84fa7b0b90d68bed92d2ba ("mm:
variable length argument support") and unmasked by
fc63cf237078c86214abcb2ee9926d8ad289da9b ("exec: setup_arg_pages() fails
to return errors").
This bug means that when limiting the stack to less the 20*PAGE_SIZE (eg.
80K on 4K pages or 'ulimit -s 79') all processes will be killed before
they start. This is particularly bad with 64K pages, where a ulimit below
1280K will kill every process.
To test, do:
'ulimit -s 15; ls'
before and after the patch is applied. Before it's applied, 'ls' should
be killed. After the patch is applied, 'ls' should no longer be killed.
A stack limit of 15KB since it's small enough to trigger 20*PAGE_SIZE.
Also 15KB not a multiple of PAGE_SIZE, which is a trickier case to handle
correctly with this code.
4K pages should be fine to test with.
[[email protected]: cleanup]
[[email protected]: cleanup cleanup]
Signed-off-by: Michael Neuling <[email protected]>
Signed-off-by: KOSAKI Motohiro <[email protected]>
Cc: Americo Wang <[email protected]>
Cc: Anton Blanchard <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: James Morris <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Serge Hallyn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/lapb/lapb_in.c')
0 files changed, 0 insertions, 0 deletions