]> git.karo-electronics.de Git - karo-tx-linux.git/commit
exec: fix stack excutability without PT_GNU_STACK
authorHugh Dickins <hugh@veritas.com>
Thu, 10 Jul 2008 20:45:02 +0000 (20:45 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 24 Jul 2008 16:14:08 +0000 (09:14 -0700)
commit557717021c28965902b9cfd6d2c60db90c492078
treecc41552c26b9ec0e245cc9045f9ed262fda0187c
parentff7d5b4baa216406b83aabfed5714e0919da7e56
exec: fix stack excutability without PT_GNU_STACK

commit 96a8e13ed44e380fc2bb6c711d74d5ba698c00b2 upstream

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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/exec.c