summaryrefslogtreecommitdiff
path: root/kern/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'kern/debug.c')
-rw-r--r--kern/debug.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/kern/debug.c b/kern/debug.c
index 109d920..67b04ad 100644
--- a/kern/debug.c
+++ b/kern/debug.c
@@ -191,3 +191,16 @@ log(int level, const char *fmt, ...)
_doprnt(fmt, &listp, do_cnputc, 0, 0);
va_end(listp);
}
+
+unsigned char __stack_chk_guard [ sizeof (vm_offset_t) ] =
+{
+ [ sizeof (vm_offset_t) - 3 ] = '\r',
+ [ sizeof (vm_offset_t) - 2 ] = '\n',
+ [ sizeof (vm_offset_t) - 1 ] = 0xff,
+};
+
+void
+__stack_chk_fail (void)
+{
+ panic("stack smashing detected");
+}