[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>
This commit is contained in:
committed by
Linus Torvalds
parent
fb911ee849
commit
9f1583339a
@@ -202,7 +202,7 @@ static void __devinit smp_store_cpu_info(int id)
|
|||||||
goto valid_k7;
|
goto valid_k7;
|
||||||
|
|
||||||
/* If we get here, it's not a certified SMP capable AMD system. */
|
/* If we get here, it's not a certified SMP capable AMD system. */
|
||||||
tainted |= TAINT_UNSAFE_SMP;
|
add_taint(TAINT_UNSAFE_SMP);
|
||||||
}
|
}
|
||||||
|
|
||||||
valid_k7:
|
valid_k7:
|
||||||
|
@@ -217,7 +217,7 @@ void do_machine_check(struct pt_regs * regs, long error_code)
|
|||||||
panicm_found = 1;
|
panicm_found = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
tainted |= TAINT_MACHINE_CHECK;
|
add_taint(TAINT_MACHINE_CHECK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Never do anything final in the polling timer */
|
/* Never do anything final in the polling timer */
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/moduleloader.h>
|
#include <linux/moduleloader.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/vmalloc.h>
|
#include <linux/vmalloc.h>
|
||||||
#include <linux/elf.h>
|
#include <linux/elf.h>
|
||||||
@@ -498,7 +499,7 @@ static inline int try_force(unsigned int flags)
|
|||||||
{
|
{
|
||||||
int ret = (flags & O_TRUNC);
|
int ret = (flags & O_TRUNC);
|
||||||
if (ret)
|
if (ret)
|
||||||
tainted |= TAINT_FORCED_MODULE;
|
add_taint(TAINT_FORCED_MODULE);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -897,7 +898,7 @@ static int check_version(Elf_Shdr *sechdrs,
|
|||||||
if (!(tainted & TAINT_FORCED_MODULE)) {
|
if (!(tainted & TAINT_FORCED_MODULE)) {
|
||||||
printk("%s: no version for \"%s\" found: kernel tainted.\n",
|
printk("%s: no version for \"%s\" found: kernel tainted.\n",
|
||||||
mod->name, symname);
|
mod->name, symname);
|
||||||
tainted |= TAINT_FORCED_MODULE;
|
add_taint(TAINT_FORCED_MODULE);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -1352,7 +1353,7 @@ static void set_license(struct module *mod, const char *license)
|
|||||||
if (!mod->license_gplok && !(tainted & TAINT_PROPRIETARY_MODULE)) {
|
if (!mod->license_gplok && !(tainted & TAINT_PROPRIETARY_MODULE)) {
|
||||||
printk(KERN_WARNING "%s: module license '%s' taints kernel.\n",
|
printk(KERN_WARNING "%s: module license '%s' taints kernel.\n",
|
||||||
mod->name, license);
|
mod->name, license);
|
||||||
tainted |= TAINT_PROPRIETARY_MODULE;
|
add_taint(TAINT_PROPRIETARY_MODULE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1610,7 +1611,7 @@ static struct module *load_module(void __user *umod,
|
|||||||
modmagic = get_modinfo(sechdrs, infoindex, "vermagic");
|
modmagic = get_modinfo(sechdrs, infoindex, "vermagic");
|
||||||
/* This is allowed: modprobe --force will invalidate it. */
|
/* This is allowed: modprobe --force will invalidate it. */
|
||||||
if (!modmagic) {
|
if (!modmagic) {
|
||||||
tainted |= TAINT_FORCED_MODULE;
|
add_taint(TAINT_FORCED_MODULE);
|
||||||
printk(KERN_WARNING "%s: no version magic, tainting kernel.\n",
|
printk(KERN_WARNING "%s: no version magic, tainting kernel.\n",
|
||||||
mod->name);
|
mod->name);
|
||||||
} else if (!same_magic(modmagic, vermagic)) {
|
} else if (!same_magic(modmagic, vermagic)) {
|
||||||
@@ -1739,7 +1740,7 @@ static struct module *load_module(void __user *umod,
|
|||||||
(mod->num_gpl_syms && !gplcrcindex)) {
|
(mod->num_gpl_syms && !gplcrcindex)) {
|
||||||
printk(KERN_WARNING "%s: No versions for exported symbols."
|
printk(KERN_WARNING "%s: No versions for exported symbols."
|
||||||
" Tainting kernel.\n", mod->name);
|
" Tainting kernel.\n", mod->name);
|
||||||
tainted |= TAINT_FORCED_MODULE;
|
add_taint(TAINT_FORCED_MODULE);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
#include <linux/pagemap.h>
|
#include <linux/pagemap.h>
|
||||||
#include <linux/bootmem.h>
|
#include <linux/bootmem.h>
|
||||||
#include <linux/compiler.h>
|
#include <linux/compiler.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/suspend.h>
|
#include <linux/suspend.h>
|
||||||
#include <linux/pagevec.h>
|
#include <linux/pagevec.h>
|
||||||
@@ -117,7 +118,7 @@ static void bad_page(const char *function, struct page *page)
|
|||||||
set_page_count(page, 0);
|
set_page_count(page, 0);
|
||||||
reset_page_mapcount(page);
|
reset_page_mapcount(page);
|
||||||
page->mapping = NULL;
|
page->mapping = NULL;
|
||||||
tainted |= TAINT_BAD_PAGE;
|
add_taint(TAINT_BAD_PAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_HUGETLB_PAGE
|
#ifndef CONFIG_HUGETLB_PAGE
|
||||||
|
Reference in New Issue
Block a user