aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@xenotime.net>2005-09-13 04:25:16 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-13 11:22:29 -0400
commit9f1583339a6f52c0c26441d39a0deff8246800f7 (patch)
tree99efa7690d22a45bf87ec80beb5e2a2d43f6b26d /kernel
parentfb911ee849756fc6c609dddded92d9207ff3fb29 (diff)
[PATCH] use add_taint() for setting tainted bit flags
Use the add_taint() interface for setting tainted bit flags instead of doing it manually. Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 4b39d3793c72..ff5c500ab625 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -20,6 +20,7 @@
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/moduleloader.h> 21#include <linux/moduleloader.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/kernel.h>
23#include <linux/slab.h> 24#include <linux/slab.h>
24#include <linux/vmalloc.h> 25#include <linux/vmalloc.h>
25#include <linux/elf.h> 26#include <linux/elf.h>
@@ -498,7 +499,7 @@ static inline int try_force(unsigned int flags)
498{ 499{
499 int ret = (flags & O_TRUNC); 500 int ret = (flags & O_TRUNC);
500 if (ret) 501 if (ret)
501 tainted |= TAINT_FORCED_MODULE; 502 add_taint(TAINT_FORCED_MODULE);
502 return ret; 503 return ret;
503} 504}
504#else 505#else
@@ -897,7 +898,7 @@ static int check_version(Elf_Shdr *sechdrs,
897 if (!(tainted & TAINT_FORCED_MODULE)) { 898 if (!(tainted & TAINT_FORCED_MODULE)) {
898 printk("%s: no version for \"%s\" found: kernel tainted.\n", 899 printk("%s: no version for \"%s\" found: kernel tainted.\n",
899 mod->name, symname); 900 mod->name, symname);
900 tainted |= TAINT_FORCED_MODULE; 901 add_taint(TAINT_FORCED_MODULE);
901 } 902 }
902 return 1; 903 return 1;
903} 904}
@@ -1352,7 +1353,7 @@ static void set_license(struct module *mod, const char *license)
1352 if (!mod->license_gplok && !(tainted & TAINT_PROPRIETARY_MODULE)) { 1353 if (!mod->license_gplok && !(tainted & TAINT_PROPRIETARY_MODULE)) {
1353 printk(KERN_WARNING "%s: module license '%s' taints kernel.\n", 1354 printk(KERN_WARNING "%s: module license '%s' taints kernel.\n",
1354 mod->name, license); 1355 mod->name, license);
1355 tainted |= TAINT_PROPRIETARY_MODULE; 1356 add_taint(TAINT_PROPRIETARY_MODULE);
1356 } 1357 }
1357} 1358}
1358 1359
@@ -1610,7 +1611,7 @@ static struct module *load_module(void __user *umod,
1610 modmagic = get_modinfo(sechdrs, infoindex, "vermagic"); 1611 modmagic = get_modinfo(sechdrs, infoindex, "vermagic");
1611 /* This is allowed: modprobe --force will invalidate it. */ 1612 /* This is allowed: modprobe --force will invalidate it. */
1612 if (!modmagic) { 1613 if (!modmagic) {
1613 tainted |= TAINT_FORCED_MODULE; 1614 add_taint(TAINT_FORCED_MODULE);
1614 printk(KERN_WARNING "%s: no version magic, tainting kernel.\n", 1615 printk(KERN_WARNING "%s: no version magic, tainting kernel.\n",
1615 mod->name); 1616 mod->name);
1616 } else if (!same_magic(modmagic, vermagic)) { 1617 } else if (!same_magic(modmagic, vermagic)) {
@@ -1739,7 +1740,7 @@ static struct module *load_module(void __user *umod,
1739 (mod->num_gpl_syms && !gplcrcindex)) { 1740 (mod->num_gpl_syms && !gplcrcindex)) {
1740 printk(KERN_WARNING "%s: No versions for exported symbols." 1741 printk(KERN_WARNING "%s: No versions for exported symbols."
1741 " Tainting kernel.\n", mod->name); 1742 " Tainting kernel.\n", mod->name);
1742 tainted |= TAINT_FORCED_MODULE; 1743 add_taint(TAINT_FORCED_MODULE);
1743 } 1744 }
1744#endif 1745#endif
1745 1746