All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][1/2] NX: Fix noexec kernel parameter
@ 2004-12-05  5:58 Zwane Mwaikambo
  2004-12-05  6:57 ` [PATCH] NX: Fix noexec kernel parameter / x86_64 Zwane Mwaikambo
  2004-12-05  7:24 ` [PATCH][1/2] NX: Fix noexec kernel parameter Zwane Mwaikambo
  0 siblings, 2 replies; 7+ messages in thread
From: Zwane Mwaikambo @ 2004-12-05  5:58 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Linux Kernel, Andrew Morton

noexec_setup runs too late to take any effect, so parse it earlier.

Signed-off-by: Zwane Mwaikambo <zwane@arm.linux.org.uk>

Index: linux-2.6.10-rc2/arch/i386/kernel/setup.c
===================================================================
RCS file: /home/cvsroot/linux-2.6.10-rc2/arch/i386/kernel/setup.c,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 setup.c
--- linux-2.6.10-rc2/arch/i386/kernel/setup.c	25 Nov 2004 19:45:32 -0000	1.1.1.1
+++ linux-2.6.10-rc2/arch/i386/kernel/setup.c	4 Dec 2004 18:43:17 -0000
@@ -737,6 +737,12 @@ static void __init parse_cmdline_early (
 			}
 		}
 
+		else if (!memcmp(from, "noexec=", 7)) {
+			extern void noexec_setup(char *str);
+
+			noexec_setup(from + 7);
+		}
+
 #ifdef  CONFIG_X86_SMP
 		/*
 		 * If the BIOS enumerates physical processors before logical,
Index: linux-2.6.10-rc2/arch/i386/mm/init.c
===================================================================
RCS file: /home/cvsroot/linux-2.6.10-rc2/arch/i386/mm/init.c,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 init.c
--- linux-2.6.10-rc2/arch/i386/mm/init.c	25 Nov 2004 19:45:32 -0000	1.1.1.1
+++ linux-2.6.10-rc2/arch/i386/mm/init.c	4 Dec 2004 18:42:40 -0000
@@ -424,7 +424,7 @@ u64 __supported_pte_mask = ~_PAGE_NX;
  * on      Enable
  * off     Disable
  */
-static int __init noexec_setup(char *str)
+void __init noexec_setup(char *str)
 {
 	if (!strncmp(str, "on",2) && cpu_has_nx) {
 		__supported_pte_mask |= _PAGE_NX;
@@ -433,11 +433,8 @@ static int __init noexec_setup(char *str
 		disable_nx = 1;
 		__supported_pte_mask &= ~_PAGE_NX;
 	}
-	return 1;
 }
 
-__setup("noexec=", noexec_setup);
-
 int nx_enabled = 0;
 #ifdef CONFIG_X86_PAE
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-12-05 10:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-05  5:58 [PATCH][1/2] NX: Fix noexec kernel parameter Zwane Mwaikambo
2004-12-05  6:57 ` [PATCH] NX: Fix noexec kernel parameter / x86_64 Zwane Mwaikambo
2004-12-05  6:59   ` Ingo Molnar
2004-12-05  7:08     ` Zwane Mwaikambo
2004-12-05 10:33       ` Ingo Molnar
2004-12-05  7:18   ` Zwane Mwaikambo
2004-12-05  7:24 ` [PATCH][1/2] NX: Fix noexec kernel parameter Zwane Mwaikambo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.