diff options
author | Florian Weimer <fweimer@redhat.com> | 2024-05-31 12:26:43 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2024-05-31 22:49:18 +0200 |
commit | c5f7f4fc8bb857cbe07972ff1e29970b101e9995 (patch) | |
tree | 3ee7b5b3127b3be0bf34b291dd0537f207b5d679 /sysdeps/unix | |
parent | 90ee0d87302810f1670a1fbcf9455b883309b1de (diff) | |
download | glibc-fw/x86-shstk-backtrace.zip glibc-fw/x86-shstk-backtrace.tar.gz glibc-fw/x86-shstk-backtrace.tar.bz2 |
x86_64: Use shadow stack for backtrace implementationfw/x86-shstk-backtrace
Test failures:
FAIL: debug/tst-backtrace4
FAIL: misc/tst-sigcontext-get_pc
The return address of signal handlers is not on the shadow stack.
Diffstat (limited to 'sysdeps/unix')
-rw-r--r-- | sysdeps/unix/sysv/linux/tst-sigcontext-get_pc.c | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/tst-sigcontext-get_pc.c b/sysdeps/unix/sysv/linux/tst-sigcontext-get_pc.c index ea375f9..df1c9c4 100644 --- a/sysdeps/unix/sysv/linux/tst-sigcontext-get_pc.c +++ b/sysdeps/unix/sysv/linux/tst-sigcontext-get_pc.c @@ -38,8 +38,10 @@ handler (int signal, siginfo_t *info, void *ctx) uintptr_t pc = sigcontext_get_pc (ctx); printf ("info: address in signal handler: 0x%" PRIxPTR "\n", pc); + printf ("info: siginfo_t address: %p\n", info); + printf ("info: ucontext_t address: %p\n", ctx); - void *callstack[10]; + void *callstack[20]; int callstack_count = backtrace (callstack, array_length (callstack)); TEST_VERIFY_EXIT (callstack_count > 0); TEST_VERIFY_EXIT (callstack_count <= array_length (callstack)); diff --git a/sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c b/sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c index b39812f..bb41cf1 100644 --- a/sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c +++ b/sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c @@ -76,6 +76,7 @@ asm \ ".align 16\n" \ ".LSTART_" #name ":\n" \ " .type __" #name ",@function\n" \ + " .globl __" #name "\n" \ "__" #name ":\n" \ " movq $" #syscall ", %rax\n" \ " syscall\n" \ |