* Turn off the CS limit completely if exec-shield disabled or
* NX active:
*/
- if (!exec_shield || executable_stack != EXSTACK_DISABLE_X)
+ if (!exec_shield || executable_stack != EXSTACK_DISABLE_X || nx_enabled)
arch_add_exec_range(current->mm, -1);
#endif
/* Do this immediately, since STACK_TOP as used in setup_arg_pages
may depend on the personality. */
SET_PERSONALITY(loc->elf_ex, ibcs2_interpreter);
- if (elf_read_implies_exec(loc->elf_ex, have_pt_gnu_stack))
+ if (exec_shield != 2 &&
+ elf_read_implies_exec(loc->elf_ex, have_pt_gnu_stack))
current->personality |= READ_IMPLIES_EXEC;
arch_pick_mmap_layout(current->mm);