aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/panic.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/panic.c')
-rw-r--r--kernel/panic.c16
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
23int panic_on_oops; 23int panic_on_oops;
24int tainted; 24int tainted;
@@ -173,6 +173,7 @@ const char *print_tainted(void)
173 173
174void add_taint(unsigned flag) 174void 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}
178EXPORT_SYMBOL(add_taint); 179EXPORT_SYMBOL(add_taint);
@@ -257,6 +258,7 @@ int oops_may_print(void)
257 */ 258 */
258void oops_enter(void) 259void 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 */
279void __stack_chk_fail(void)
280{
281 panic("stack-protector: Kernel stack is corrupted");
282}
283EXPORT_SYMBOL(__stack_chk_fail);
284#endif