diff options
author | Andi Kleen <ak@suse.de> | 2006-09-26 10:52:28 +0200 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-09-26 10:52:28 +0200 |
commit | c16b63e09d9d03158e0a92e961234e94c4862620 (patch) | |
tree | 154c9b5e082bf0633482be6c33c973cc35c602d8 /fs/binfmt_elf.c | |
parent | d5d9ca6d882f7c8d47ef91a701fc042cbebbc334 (diff) | |
download | linux-c16b63e09d9d03158e0a92e961234e94c4862620.tar.gz linux-c16b63e09d9d03158e0a92e961234e94c4862620.tar.bz2 linux-c16b63e09d9d03158e0a92e961234e94c4862620.zip |
[PATCH] i386/x86-64: Don't randomize stack top when no randomization personality is set
Based on patch from Frank van Maarseveen <frankvm@frankvm.com>, but
extended.
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r-- | fs/binfmt_elf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 672a3b90bc55..5109dbff93bf 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -515,7 +515,8 @@ static unsigned long randomize_stack_top(unsigned long stack_top) { unsigned int random_variable = 0; - if (current->flags & PF_RANDOMIZE) { + if ((current->flags & PF_RANDOMIZE) && + !(current->personality & ADDR_NO_RANDOMIZE)) { random_variable = get_random_int() & STACK_RND_MASK; random_variable <<= PAGE_SHIFT; } |