[lkml]   [2006]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[patch 4/5] -fstack-protector feature: Add the __stack_chk_fail() function
Subject: [patch 4/5] Add the __stack_chk_fail() function

GCC emits a call to a __stack_chk_fail() function when the stack canary is
not matching the expected value.

Since this is a bad security issue; lets panic the kernel rather than limping
along; the kernel really can't be trusted anymore when this happens.

Signed-off-by: Arjan van de Ven <>
Signed-off-by: Ingo Molnar <>
CC: Andi Kleen <>

kernel/panic.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

Index: linux-2.6.18-rc4-stackprot/kernel/panic.c
--- linux-2.6.18-rc4-stackprot.orig/kernel/panic.c
+++ linux-2.6.18-rc4-stackprot/kernel/panic.c
@@ -269,3 +269,15 @@ void oops_exit(void)
+ * 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");
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2006-08-16 19:13    [W:0.093 / U:3.356 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site