]> git.baikalelectronics.ru Git - kernel.git/commit
fdpic: ignore the loader's PT_GNU_STACK when calculating the stack size
authorDavid Howells <dhowells@redhat.com>
Wed, 23 Sep 2009 22:57:06 +0000 (15:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Sep 2009 14:21:02 +0000 (07:21 -0700)
commitb873170f526fb6d5a17d04ad8783be1140aac320
tree82339b06388b2002557ec5fab7dcfa72c918b3c6
parent797ce8390cae4549a3fc81d33daf0d949d40f88a
fdpic: ignore the loader's PT_GNU_STACK when calculating the stack size

Ignore the loader's PT_GNU_STACK when calculating the stack size, and only
consider the executable's PT_GNU_STACK, assuming the executable has one.

Currently the behaviour is to take the largest stack size and use that,
but that means you can't reduce the stack size in the executable.  The
loader's stack size should probably only be used when executing the loader
directly.

WARNING: This patch is slightly dangerous - it may render a system
inoperable if the loader's stack size is larger than that of important
executables, and the system relies unknowingly on this increasing the size
of the stack.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/binfmt_elf_fdpic.c