]> git.baikalelectronics.ru Git - kernel.git/commit
exec: fix stack excutability without PT_GNU_STACK
authorHugh Dickins <hugh@veritas.com>
Thu, 10 Jul 2008 20:19:20 +0000 (21:19 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 10 Jul 2008 20:25:43 +0000 (13:25 -0700)
commit47d19b9ab29a7790f1366c7791150fe474aa1477
tree62eb5b26a3cfe678f82f9d5c131b08114950f551
parent08025fc9e80a88ae077682d1772c87a3868548da
exec: fix stack excutability without PT_GNU_STACK

Kernel Bugzilla #11063 points out that on some architectures (e.g. x86_32)
exec'ing an ELF without a PT_GNU_STACK program header should default to an
executable stack; but this got broken by the unlimited argv feature because
stack vma is now created before the right personality has been established:
so breaking old binaries using nested function trampolines.

Therefore re-evaluate VM_STACK_FLAGS in setup_arg_pages, where stack
vm_flags used to be set, before the mprotect_fixup.  Checking through
our existing VM_flags, none would have changed since insert_vm_struct:
so this seems safer than finding a way through the personality labyrinth.

Reported-by: pageexec@freemail.hu
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/exec.c