1 #include <linux/spinlock.h>
2 #include <linux/errno.h>
3 #include <linux/init.h>
5 #include <asm/pgtable.h>
13 * Control non-executable mappings for processes.
18 static int __init
noexec_setup(char *str
)
22 if (!strncmp(str
, "on", 2)) {
24 } else if (!strncmp(str
, "off", 3)) {
30 early_param("noexec", noexec_setup
);
32 void x86_configure_nx(void)
34 if (cpu_has_nx
&& !disable_nx
)
35 __supported_pte_mask
|= _PAGE_NX
;
37 __supported_pte_mask
&= ~_PAGE_NX
;
40 void __init
x86_report_nx(void)
43 printk(KERN_NOTICE
"Notice: NX (Execute Disable) protection "
46 #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
48 printk(KERN_INFO
"NX (Execute Disable) protection: "
49 "disabled by kernel command line option\n");
51 printk(KERN_INFO
"NX (Execute Disable) protection: "
55 /* 32bit non-PAE kernel, NX cannot be used */
56 printk(KERN_NOTICE
"Notice: NX (Execute Disable) protection "
57 "cannot be enabled: non-PAE kernel!\n");