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

Issue 11416326: SECCOMP-BPF: Fix SandboxSyscall() (Closed)

Created:
8 years ago by Markus (顧孟勤)
Modified:
8 years ago
CC:
chromium-reviews, agl, jln+watch_chromium.org
Visibility:
Public.

Description

SECCOMP-BPF: Fix SandboxSyscall() - Eliminate variadic arguments in favor of C++ templates. This makes ASAN and Valgrind much happier, as we are no longer accessing more arguments than what has been passed into our function (i.e. in the past, we'd always forward six arguments to the kernel, even if the system call needed fewer; now, we explicitly pass zeros). - In the past, callers had to be very careful when passing NULL, as the C++ compiler was likely to treat this macro as a 32bit integer value rather than a 64bit pointer. We now always perform sign extension for expanding arguments to the full native word width. - On x86-64, we could clobber up to eight (in some cases 16) bytes in the red zone. This would typically only happen when high optimization levels were turned on, and in many cases it ended up overwriting data that was no longer needed. But we have seen at least one case where we ended up clobbering a system call parameter. We now explicitly avoid the red zone and this problem can no longer happen. BUG=163904, 162925 TEST=sandbox_linux_unittests NOTRY=true Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=170896

Patch Set 1 #

Total comments: 16

Patch Set 2 : Fix the handling of red zones. This fixes a crash on the bots and overall makes valgrind much happi… #

Patch Set 3 : Addressed Jeffrey's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+125 lines, -68 lines) Patch
M sandbox/linux/seccomp-bpf/sandbox_bpf.h View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M sandbox/linux/seccomp-bpf/syscall.h View 1 2 2 chunks +102 lines, -2 lines 0 comments Download
M sandbox/linux/seccomp-bpf/syscall.cc View 1 2 4 chunks +17 lines, -66 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Markus (顧孟勤)
Hopefully, this CL will take care of all the bugs we have received from both ...
8 years ago (2012-12-03 21:30:07 UTC) #1
jln (very slow on Chromium)
On 2012/12/03 21:30:07, Markus (顧孟勤) wrote: > Hopefully, this CL will take care of all ...
8 years ago (2012-12-03 21:54:43 UTC) #2
Jeffrey Yasskin
https://chromiumcodereview.appspot.com/11416326/diff/1/sandbox/linux/seccomp-bpf/syscall.cc File sandbox/linux/seccomp-bpf/syscall.cc (right): https://chromiumcodereview.appspot.com/11416326/diff/1/sandbox/linux/seccomp-bpf/syscall.cc#newcode188 sandbox/linux/seccomp-bpf/syscall.cc:188: if (sizeof(void *) != sizeof(intptr_t)) { You can compile-assert ...
8 years ago (2012-12-03 22:27:35 UTC) #3
Jeffrey Yasskin
https://codereview.chromium.org/11416326/diff/1/sandbox/linux/seccomp-bpf/syscall.cc File sandbox/linux/seccomp-bpf/syscall.cc (right): https://codereview.chromium.org/11416326/diff/1/sandbox/linux/seccomp-bpf/syscall.cc#newcode182 sandbox/linux/seccomp-bpf/syscall.cc:182: // that this would only be an issue for ...
8 years ago (2012-12-03 22:40:16 UTC) #4
Markus (顧孟勤)
Jeffrey, I think almost all of your comments were informational -- and I always appreciate ...
8 years ago (2012-12-04 00:54:38 UTC) #5
Jeffrey Yasskin
lgtm https://chromiumcodereview.appspot.com/11416326/diff/1/sandbox/linux/seccomp-bpf/syscall.cc File sandbox/linux/seccomp-bpf/syscall.cc (right): https://chromiumcodereview.appspot.com/11416326/diff/1/sandbox/linux/seccomp-bpf/syscall.cc#newcode182 sandbox/linux/seccomp-bpf/syscall.cc:182: // that this would only be an issue ...
8 years ago (2012-12-04 01:18:48 UTC) #6
jln (very slow on Chromium)
lgtm Sadly, linux_asan does not include sandbox_linux_unittests (which I should change ASAP), but I tested ...
8 years ago (2012-12-04 04:09:36 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/markus@chromium.org/11416326/9001
8 years ago (2012-12-04 04:13:43 UTC) #8
jln (very slow on Chromium)
On 2012/12/04 04:13:43, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
8 years ago (2012-12-04 06:46:48 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/markus@chromium.org/11416326/9001
8 years ago (2012-12-04 06:47:53 UTC) #10
commit-bot: I haz the power
8 years ago (2012-12-04 06:48:02 UTC) #11
Message was sent while issue was closed.
Change committed as 170896

Powered by Google App Engine
This is Rietveld 408576698