]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
minios: _chk_fail and _chk canaries for minios and newlib
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 31 Mar 2009 10:36:11 +0000 (11:36 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 31 Mar 2009 10:36:11 +0000 (11:36 +0100)
Add __stack_chk_fail to mini-os and __sprintf_chk __fprintf_chk to
newlib, to cope with ocaml runtimes compiled with -fstack-protector.

From: "George S. Coker, II" <gscoker@alpha.ncsc.mil>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
lib/stack_chk_fail.c [new file with mode: 0644]

diff --git a/lib/stack_chk_fail.c b/lib/stack_chk_fail.c
new file mode 100644 (file)
index 0000000..ade0045
--- /dev/null
@@ -0,0 +1,8 @@
+#include <kernel.h>
+#include <console.h>
+
+void __stack_chk_fail(void)
+{
+    printk("stack smashing detected\n");
+    do_exit();
+}