DescriptionSyscall: Fix Syscall::Call's X86-64 implementation for CFI unwinding
The LEA instruction within the inline assembly statement was throwing
off glibc's backtrace() function, because it lost track of where the
stack was. The easy fix for this is to convert SyscallAsm() to simply
use the standard C calling convention on X86-64, and make it into a
normal C function call so the compiler can ensure CFI information is
correct for us.
While here, there's no need to use the "call/pop/addq" trick to
compute a PC-relative address because we have %rip-based addressing.
So simply use "lea 2f(%rip), %rax" to compute the return address (and
avoid branch mispredictions from desync'ing the call stack).
BUG=424973
Committed: https://crrev.com/77a224a0aacac5bff5af234b5a583f499ebb146f
Cr-Commit-Position: refs/heads/master@{#300374}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Try re-enabling Baseline.SIGSYS_InvalidSyscall #
Total comments: 6
Patch Set 3 : Respond to rickyz/jln feedback #Patch Set 4 : Tweak wording #
Messages
Total messages: 15 (4 generated)
|