Skip to contentSkip to conversation

no verify_write when CONFIG_WP_WORKS_OK=y

PATCH New Paul Gortmaker 1 participant 1 message Mar 17, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 no verify_write when CONFIG_WP_WORKS_OK=y

Quoted 2 lines · Linus Torvalds

Note that the i386 has _long_ been a "stepchild", though: because of the lack of WP, the kernel simply doesn't do threaded MM correctly on a 386.

That reminds me of a patch to gut verify_write when CONFIG_X86_WP_WORKS_OK=y. Saves a few bytes. Patch is against 2.5.7pre2.

We could bin the whole thing and stop exporting it, but there may be users who try to load binary only modules that were built for 386 and hence expect verify_write to be exported regardless of CPU type the kernel was built for.

Paul.

i386/mm/fault.c renamed from linux/arch/i386/mm/fault.c +5 -0
@@ -4,6 +4,7 @@
  *  Copyright (C) 1995  Linus Torvalds
  */
 
+#include <linux/config.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -29,6 +30,9 @@
 
 extern int console_loglevel;
 
+#ifdef CONFIG_X86_WP_WORKS_OK
+int __verify_write(const void * addr, unsigned long size) {return 1;}
+#else
 /*
  * Ugly, ugly, but the goto's result in better assembly..
  */
@@ -93,6 +97,7 @@
 	}
 	goto bad_area;
 }
+#endif
 
 extern spinlock_t timerlist_lock;