diff options
Diffstat (limited to 'kernel/panic.c')
| -rw-r--r-- | kernel/panic.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/kernel/panic.c b/kernel/panic.c index cc2a4c9c36ac..525e365f7239 100644 --- a/kernel/panic.c +++ b/kernel/panic.c | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | * This function is used through-out the kernel (including mm and fs) | 8 | * This function is used through-out the kernel (including mm and fs) |
| 9 | * to indicate a major problem. | 9 | * to indicate a major problem. |
| 10 | */ | 10 | */ |
| 11 | #include <linux/config.h> | ||
| 12 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 13 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
| 14 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
| @@ -19,6 +18,7 @@ | |||
| 19 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
| 20 | #include <linux/nmi.h> | 19 | #include <linux/nmi.h> |
| 21 | #include <linux/kexec.h> | 20 | #include <linux/kexec.h> |
| 21 | #include <linux/debug_locks.h> | ||
| 22 | 22 | ||
| 23 | int panic_on_oops; | 23 | int panic_on_oops; |
| 24 | int tainted; | 24 | int tainted; |
| @@ -173,6 +173,7 @@ const char *print_tainted(void) | |||
| 173 | 173 | ||
| 174 | void add_taint(unsigned flag) | 174 | void add_taint(unsigned flag) |
| 175 | { | 175 | { |
| 176 | debug_locks = 0; /* can't trust the integrity of the kernel anymore */ | ||
| 176 | tainted |= flag; | 177 | tainted |= flag; |
| 177 | } | 178 | } |
| 178 | EXPORT_SYMBOL(add_taint); | 179 | EXPORT_SYMBOL(add_taint); |
| @@ -257,6 +258,7 @@ int oops_may_print(void) | |||
| 257 | */ | 258 | */ |
| 258 | void oops_enter(void) | 259 | void oops_enter(void) |
| 259 | { | 260 | { |
| 261 | debug_locks_off(); /* can't trust the integrity of the kernel anymore */ | ||
| 260 | do_oops_enter_exit(); | 262 | do_oops_enter_exit(); |
| 261 | } | 263 | } |
| 262 | 264 | ||
| @@ -268,3 +270,15 @@ void oops_exit(void) | |||
| 268 | { | 270 | { |
| 269 | do_oops_enter_exit(); | 271 | do_oops_enter_exit(); |
| 270 | } | 272 | } |
| 273 | |||
| 274 | #ifdef CONFIG_CC_STACKPROTECTOR | ||
| 275 | /* | ||
| 276 | * Called when gcc's -fstack-protector feature is used, and | ||
| 277 | * gcc detects corruption of the on-stack canary value | ||
| 278 | */ | ||
| 279 | void __stack_chk_fail(void) | ||
| 280 | { | ||
| 281 | panic("stack-protector: Kernel stack is corrupted"); | ||
| 282 | } | ||
| 283 | EXPORT_SYMBOL(__stack_chk_fail); | ||
| 284 | #endif | ||
