Skip to content

Commit

Permalink
[PATCH] module support: record in vermagic ability to unload a module
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Rusty Russell <[email protected]>
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Linus Torvalds committed Apr 11, 2006
1 parent 7ad04b0 commit 5ac90c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/linux/vermagic.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@
#else
#define MODULE_VERMAGIC_PREEMPT ""
#endif
#ifdef CONFIG_MODULE_UNLOAD
#define MODULE_VERMAGIC_MODULE_UNLOAD "mod_unload "
#else
#define MODULE_VERMAGIC_MODULE_UNLOAD ""
#endif
#ifndef MODULE_ARCH_VERMAGIC
#define MODULE_ARCH_VERMAGIC ""
#endif

#define VERMAGIC_STRING \
UTS_RELEASE " " \
MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \
MODULE_ARCH_VERMAGIC \
MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC \
"gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__)

0 comments on commit 5ac90c9

Please sign in to comment.