]> git.ipfire.org Git - people/ms/linux.git/commit
metag: Reduce maximum stack size to 256MB
authorJames Hogan <james.hogan@imgtec.com>
Tue, 13 May 2014 22:58:24 +0000 (23:58 +0100)
committerJiri Slaby <jslaby@suse.cz>
Mon, 9 Jun 2014 13:53:41 +0000 (15:53 +0200)
commit3aa3ff52dc8f87de726372855a405bbea1b343c1
tree7deef6001ab32ae599999a12bbe771336fd8ab1f
parent02f7ba733eca7c2dfce111ebff4558de51d5ce15
metag: Reduce maximum stack size to 256MB

commit d71f290b4e98a39f49f2595a13be3b4d5ce8e1f1 upstream.

Specify the maximum stack size for arches where the stack grows upward
(parisc and metag) in asm/processor.h rather than hard coding in
fs/exec.c so that metag can specify a smaller value of 256MB rather than
1GB.

This fixes a BUG on metag if the RLIMIT_STACK hard limit is increased
beyond a safe value by root. E.g. when starting a process after running
"ulimit -H -s unlimited" it will then attempt to use a stack size of the
maximum 1GB which is far too big for metag's limited user virtual
address space (stack_top is usually 0x3ffff000):

BUG: failure at fs/exec.c:589/shift_arg_pages()!

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Helge Deller <deller@gmx.de>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: linux-parisc@vger.kernel.org
Cc: linux-metag@vger.kernel.org
Cc: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/metag/include/asm/processor.h
arch/parisc/include/asm/processor.h
fs/exec.c