aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
authorAndi Kleen <andi@firstfloor.org>2008-10-16 01:01:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 14:21:31 -0400
commit25ddbb18aae33ad255eb9f35aacebe3af01e1e9c (patch)
tree8df1f840a226ed640c2096710b7d0f1f4d1b88aa /include/linux/kernel.h
parent889d51a10712b6fd6175196626de2116858394f4 (diff)
Make the taint flags reliable
It's somewhat unlikely that it happens, but right now a race window between interrupts or machine checks or oopses could corrupt the tainted bitmap because it is modified in a non atomic fashion. Convert the taint variable to an unsigned long and use only atomic bit operations on it. Unfortunately this means the intvec sysctl functions cannot be used on it anymore. It turned out the taint sysctl handler could actually be simplified a bit (since it only increases capabilities) so this patch actually removes code. [akpm@linux-foundation.org: remove unneeded include] Signed-off-by: Andi Kleen <ak@linux.intel.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 75d81f157d2e..e971c55f45ac 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -235,9 +235,10 @@ extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in
235extern int panic_timeout; 235extern int panic_timeout;
236extern int panic_on_oops; 236extern int panic_on_oops;
237extern int panic_on_unrecovered_nmi; 237extern int panic_on_unrecovered_nmi;
238extern int tainted;
239extern const char *print_tainted(void); 238extern const char *print_tainted(void);
240extern void add_taint(unsigned); 239extern void add_taint(unsigned flag);
240extern int test_taint(unsigned flag);
241extern unsigned long get_taint(void);
241extern int root_mountflags; 242extern int root_mountflags;
242 243
243/* Values used for system_state */ 244/* Values used for system_state */
@@ -250,16 +251,16 @@ extern enum system_states {
250 SYSTEM_SUSPEND_DISK, 251 SYSTEM_SUSPEND_DISK,
251} system_state; 252} system_state;
252 253
253#define TAINT_PROPRIETARY_MODULE (1<<0) 254#define TAINT_PROPRIETARY_MODULE 0
254#define TAINT_FORCED_MODULE (1<<1) 255#define TAINT_FORCED_MODULE 1
255#define TAINT_UNSAFE_SMP (1<<2) 256#define TAINT_UNSAFE_SMP 2
256#define TAINT_FORCED_RMMOD (1<<3) 257#define TAINT_FORCED_RMMOD 3
257#define TAINT_MACHINE_CHECK (1<<4) 258#define TAINT_MACHINE_CHECK 4
258#define TAINT_BAD_PAGE (1<<5) 259#define TAINT_BAD_PAGE 5
259#define TAINT_USER (1<<6) 260#define TAINT_USER 6
260#define TAINT_DIE (1<<7) 261#define TAINT_DIE 7
261#define TAINT_OVERRIDDEN_ACPI_TABLE (1<<8) 262#define TAINT_OVERRIDDEN_ACPI_TABLE 8
262#define TAINT_WARN (1<<9) 263#define TAINT_WARN 9
263 264
264extern void dump_stack(void) __cold; 265extern void dump_stack(void) __cold;
265 266