public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] module: put modversions in vermagic
@ 2008-05-09  6:23 Rusty Russell
  2008-05-09  6:24 ` [PATCH 2/3] module: be more picky about allowing missing module versions Rusty Russell
  0 siblings, 1 reply; 5+ messages in thread
From: Rusty Russell @ 2008-05-09  6:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jon Masters, Linus Torvalds

Don't allow a module built without versions altogether to be inserted
into a kernel which expects modversions.

modprobe --force will strip vermagic as well as modversions, so it
won't be effected, but this will make sure that a
non-CONFIG_MODVERSIONS module won't be accidentally inserted into a
CONFIG_MODVERSIONS kernel.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 include/linux/vermagic.h |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff -r a39eaf516de9 include/linux/vermagic.h
--- a/include/linux/vermagic.h	Thu May 08 14:20:44 2008 +1000
+++ b/include/linux/vermagic.h	Thu May 08 15:18:47 2008 +1000
@@ -17,6 +17,11 @@
 #else
 #define MODULE_VERMAGIC_MODULE_UNLOAD ""
 #endif
+#ifdef CONFIG_MODVERSIONS
+#define MODULE_VERMAGIC_MODVERSIONS "modversions "
+#else
+#define MODULE_VERMAGIC_MODVERSIONS ""
+#endif
 #ifndef MODULE_ARCH_VERMAGIC
 #define MODULE_ARCH_VERMAGIC ""
 #endif
@@ -24,5 +29,6 @@
 #define VERMAGIC_STRING 						\
 	UTS_RELEASE " "							\
 	MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT 			\
-	MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC
+	MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS	\
+	MODULE_ARCH_VERMAGIC
 

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

end of thread, other threads:[~2008-05-11  0:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-09  6:23 [PATCH 1/3] module: put modversions in vermagic Rusty Russell
2008-05-09  6:24 ` [PATCH 2/3] module: be more picky about allowing missing module versions Rusty Russell
2008-05-09  6:25   ` [PATCH 3/3] module: don't ignore vermagic string if module doesn't have modversions Rusty Russell
2008-05-09 14:44     ` Linus Torvalds
2008-05-11  0:57       ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox