diff options
author | Kees Cook <kees.cook@canonical.com> | 2010-05-25 10:38:53 -0700 |
---|---|---|
committer | Leann Ogasawara <leann.ogasawara@canonical.com> | 2010-09-02 13:43:21 -0700 |
commit | 57c90af34c93f4e11138865a857a9a3cdc6d1c35 (patch) | |
tree | 851d7cbd09655967677d88405222abaded1fa5e6 /fs | |
parent | 2fa96d1e3d8f4a3012340525a01835fb2fd6e0b7 (diff) |
UBUNTU: SAUCE: x86: more tightly confine cs-limit nx-emulation to ia32 only
This makes sure to not disable fast syscalls too generally, and clarifies
nx-emulation code a bit more.
Signed-off-by: Kees Cook <kees.cook@canonical.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/binfmt_elf.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index d114af6d44d..c95463dc7d6 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -701,10 +701,12 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) break; } +#ifdef CONFIG_X86_32 if (current->personality == PER_LINUX && (exec_shield & 2)) { executable_stack = EXSTACK_DISABLE_X; current->flags |= PF_RANDOMIZE; } +#endif /* Some simple consistency checks for the interpreter */ if (elf_interpreter) { @@ -738,8 +740,11 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs) /* Do this immediately, since STACK_TOP as used in setup_arg_pages may depend on the personality. */ SET_PERSONALITY(loc->elf_ex); - if (!(exec_shield & 2) && - elf_read_implies_exec(loc->elf_ex, executable_stack)) + if (elf_read_implies_exec(loc->elf_ex, executable_stack) +#ifdef CONFIG_X86_32 + && !(exec_shield & 2) +#endif + ) current->personality |= READ_IMPLIES_EXEC; if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space) |