diff options
author | Ulrich Drepper <drepper@redhat.com> | 2009-05-15 19:28:04 -0700 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2009-05-15 19:37:13 -0700 |
commit | b50f8e42ba3010f0141e6a482e0820f658e89b63 (patch) | |
tree | 80cef469731d5857499883d45fd3424730f0db7c /sysdeps/x86_64/__longjmp.S | |
parent | f1342e0be8e222dbca077beca94b5937564e8c4b (diff) | |
download | glibc-b50f8e42ba3010f0141e6a482e0820f658e89b63.tar.gz glibc-b50f8e42ba3010f0141e6a482e0820f658e89b63.tar.xz glibc-b50f8e42ba3010f0141e6a482e0820f658e89b63.zip |
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.
Diffstat (limited to 'sysdeps/x86_64/__longjmp.S')
-rw-r--r-- | sysdeps/x86_64/__longjmp.S | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/x86_64/__longjmp.S b/sysdeps/x86_64/__longjmp.S index a68e7a8a4f..7649e99242 100644 --- a/sysdeps/x86_64/__longjmp.S +++ b/sysdeps/x86_64/__longjmp.S @@ -33,6 +33,9 @@ ENTRY(__longjmp) PTR_DEMANGLE (%r9) PTR_DEMANGLE (%rdx) #endif +#ifdef CHECK_RSP + CHECK_RSP (%r8) +#endif /* We add unwind information for the target here. */ cfi_def_cfa(%rdi, 0) cfi_register(%rsp,%r8) |