Commit 5ac90c9f authored by Paolo 'Blaisorblade' Giarrusso's avatar Paolo 'Blaisorblade' Giarrusso Committed by Linus Torvalds

[PATCH] module support: record in vermagic ability to unload a module

An UML user reported (against 2.6.13.3/UML) he got kernel Oopses when
trying to rmmod (on a kernel with module unloading enabled) a module
compiled with module unloading disabled.  As crashing is a very correct
thing to do in that case, a solution is altering the vermagic string to
include this too.

Possibly, however, the code should not crash in this case, even if the
module didn't support unloading - it should simply abort the module
removal.  In this case, fixing that bug would be a better solution.  I've
not investigated though.

(akpm: a bit marginal - root screwed up and shot himself in the foot).

Cc: Hayim Shaul <hayim@post.tau.ac.il>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7ad04b0d
...@@ -12,6 +12,11 @@ ...@@ -12,6 +12,11 @@
#else #else
#define MODULE_VERMAGIC_PREEMPT "" #define MODULE_VERMAGIC_PREEMPT ""
#endif #endif
#ifdef CONFIG_MODULE_UNLOAD
#define MODULE_VERMAGIC_MODULE_UNLOAD "mod_unload "
#else
#define MODULE_VERMAGIC_MODULE_UNLOAD ""
#endif
#ifndef MODULE_ARCH_VERMAGIC #ifndef MODULE_ARCH_VERMAGIC
#define MODULE_ARCH_VERMAGIC "" #define MODULE_ARCH_VERMAGIC ""
#endif #endif
...@@ -19,5 +24,5 @@ ...@@ -19,5 +24,5 @@
#define VERMAGIC_STRING \ #define VERMAGIC_STRING \
UTS_RELEASE " " \ UTS_RELEASE " " \
MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \ MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \
MODULE_ARCH_VERMAGIC \ MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC \
"gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__) "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment