From b50f8e42ba3010f0141e6a482e0820f658e89b63 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 15 May 2009 19:28:04 -0700 Subject: Check for valid stack frame in longjmp. If longjmp restores the stack frame to an address which is beyond the stack frame at the time of the longjmp call it would install an uninitialized stack frame. If compiled with _FORTIFY_SOURCE defined, longjmp will now bail out in this situation. --- include/bits/setjmp2.h | 1 + include/stdio.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 include/bits/setjmp2.h (limited to 'include') diff --git a/include/bits/setjmp2.h b/include/bits/setjmp2.h new file mode 100644 index 0000000..bdb222c --- /dev/null +++ b/include/bits/setjmp2.h @@ -0,0 +1 @@ +#include diff --git a/include/stdio.h b/include/stdio.h index 9fdafe4..a8aab92 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -90,7 +90,8 @@ extern int __gen_tempname (char *__tmpl, int __flags, int __kind); extern void __libc_fatal (__const char *__message) __attribute__ ((__noreturn__)); extern void __libc_message (int do_abort, __const char *__fnt, ...); -extern void __fortify_fail (const char *msg) __attribute__ ((noreturn)); +extern void __fortify_fail (const char *msg) + __attribute__ ((__noreturn__)) internal_function; libc_hidden_proto (__fortify_fail) /* Acquire ownership of STREAM. */ -- cgit v1.1