]> err.no Git - linux-2.6/blobdiff - kernel/panic.c
[PATCH] Add the __stack_chk_fail() function
[linux-2.6] / kernel / panic.c
index d2db3e2209e0e20ae64f8c1537a09a048e95edfe..6ceb664fb52aec50c9c2d922c5c8cf17ad5979b2 100644 (file)
@@ -271,3 +271,15 @@ void oops_exit(void)
 {
        do_oops_enter_exit();
 }
+
+#ifdef CONFIG_CC_STACKPROTECTOR
+/*
+ * Called when gcc's -fstack-protector feature is used, and
+ * gcc detects corruption of the on-stack canary value
+ */
+void __stack_chk_fail(void)
+{
+       panic("stack-protector: Kernel stack is corrupted");
+}
+EXPORT_SYMBOL(__stack_chk_fail);
+#endif