Skip to contentSkip to conversation

Make rmmod -f taint kernel.

PATCH New Rusty Russell 1 participant 1 message Jul 18, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make rmmod -f taint kernel.

Trivial, but somehow this got lost. Mark kernel as tainted when a kernel removal is forced.

Name: Make force taint kernel.
Author: Rusty Russell
Status: Tested on 2.5.56

D: Somehow, the code which taints the kernel when rmmod -f is used got
D: lost. Restore it.

kernel/module.c +4 -1
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .1819-linux-2.5.69-bk3/kernel/module.c .1819-linux-2.5.69-bk3.updated/kernel/module.c
@@ -447,7 +447,10 @@ static void free_module(struct module *m
 #ifdef CONFIG_MODULE_FORCE_UNLOAD
 static inline int try_force(unsigned int flags)
 {
-	return (flags & O_TRUNC);
+	int ret = (flags & O_TRUNC);
+	if (ret)
+		tainted |= TAINT_FORCED_MODULE;
+	return ret;
 }
 #else
 static inline int try_force(unsigned int flags)

--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.