Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Issue 661393004: Syscall: Fix Syscall::Call's X86-64 implementation for CFI unwinding (Closed)

Created:
6 years, 2 months ago by mdempsky
Modified:
6 years, 2 months ago
CC:
chromium-reviews, jln+watch_chromium.org, jln (very slow on Chromium), rickyz (no longer on Chrome)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Syscall: 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -40 lines) Patch
M sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc View 1 1 chunk +0 lines, -3 lines 0 comments Download
M sandbox/linux/seccomp-bpf/syscall.cc View 1 2 3 3 chunks +22 lines, -37 lines 0 comments Download

Messages

Total messages: 15 (4 generated)
mdempsky
Seems to work locally. Can one of you test on the PFQ or tell me ...
6 years, 2 months ago (2014-10-20 20:26:47 UTC) #2
Jorge Lucangeli Obes
On 2014/10/20 20:26:47, mdempsky wrote: > Seems to work locally. Can one of you test ...
6 years, 2 months ago (2014-10-20 20:31:05 UTC) #3
Jorge Lucangeli Obes
On 2014/10/20 20:31:05, Jorge Lucangeli Obes wrote: > On 2014/10/20 20:26:47, mdempsky wrote: > > ...
6 years, 2 months ago (2014-10-20 20:35:47 UTC) #4
mdempsky
On 2014/10/20 20:35:47, Jorge Lucangeli Obes wrote: > On 2014/10/20 20:31:05, Jorge Lucangeli Obes wrote: ...
6 years, 2 months ago (2014-10-20 20:37:09 UTC) #5
rickyz (Google)
Nice catch :-) Hope this passes! https://codereview.chromium.org/661393004/diff/1/sandbox/linux/seccomp-bpf/syscall.cc File sandbox/linux/seccomp-bpf/syscall.cc (right): https://codereview.chromium.org/661393004/diff/1/sandbox/linux/seccomp-bpf/syscall.cc#newcode92 sandbox/linux/seccomp-bpf/syscall.cc:92: // Check if ...
6 years, 2 months ago (2014-10-20 20:39:53 UTC) #7
jln (very slow on Chromium)
lgtm, this should be a lot more future-proof! https://codereview.chromium.org/661393004/diff/20001/sandbox/linux/seccomp-bpf/syscall.cc File sandbox/linux/seccomp-bpf/syscall.cc (right): https://codereview.chromium.org/661393004/diff/20001/sandbox/linux/seccomp-bpf/syscall.cc#newcode92 sandbox/linux/seccomp-bpf/syscall.cc:92: // ...
6 years, 2 months ago (2014-10-20 21:24:02 UTC) #9
mdempsky
https://codereview.chromium.org/661393004/diff/1/sandbox/linux/seccomp-bpf/syscall.cc File sandbox/linux/seccomp-bpf/syscall.cc (right): https://codereview.chromium.org/661393004/diff/1/sandbox/linux/seccomp-bpf/syscall.cc#newcode92 sandbox/linux/seccomp-bpf/syscall.cc:92: // Check if "%rax" is negative. If so, do ...
6 years, 2 months ago (2014-10-20 21:41:21 UTC) #10
mdempsky
jorgelo@ reports this appears to have fixed the Chrome OS buildbot, so sending to CQ.
6 years, 2 months ago (2014-10-20 22:05:27 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/661393004/60001
6 years, 2 months ago (2014-10-20 22:06:27 UTC) #13
commit-bot: I haz the power
Committed patchset #4 (id:60001)
6 years, 2 months ago (2014-10-20 23:19:33 UTC) #14
commit-bot: I haz the power
6 years, 2 months ago (2014-10-20 23:20:24 UTC) #15
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/77a224a0aacac5bff5af234b5a583f499ebb146f
Cr-Commit-Position: refs/heads/master@{#300374}

Powered by Google App Engine
This is Rietveld 408576698