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

Issue 10542028: Explicitly test bit 30 in the system call number to distinguish between the new x32 API and older I… (Closed)

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

Description

Explicitly test bit 30 in the system call number to distinguish between the new x32 API and older Intel APIs. Also, extend the system call range from 0..512 to 0..1024. This covers the extra system calls added with x32. As x32 isn't widely available yet, we don't add any other code to support it (e.g. we don't build a version of demo.cc that runs in x32). But by explicitly blocking it for i386 and x86-64 we ensure that a "default allow" policy is going to do the right thing. TEST=make && demo32 && demo64 BUG=130662 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=141155

Patch Set 1 #

Total comments: 6

Patch Set 2 : Switched return codes to kill on error #

Total comments: 1

Patch Set 3 : Rebased #

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

Messages

Total messages: 5 (0 generated)
Markus (顧孟勤)
I don't fully understand how x32 is going to work, and even if I did, ...
8 years, 6 months ago (2012-06-06 15:08:44 UTC) #1
Markus (顧孟勤)
I agree about your concern. I have been thinking how to do this most cleanly ...
8 years, 6 months ago (2012-06-06 22:59:34 UTC) #2
Chris Evans
https://chromiumcodereview.appspot.com/10542028/diff/1/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://chromiumcodereview.appspot.com/10542028/diff/1/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode222 sandbox/linux/seccomp-bpf/sandbox_bpf.cc:222: BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ERRNO + SECCOMP_DENY_ERRNO)); This should probably be SECCOMP_RET_KILL ...
8 years, 6 months ago (2012-06-07 01:02:38 UTC) #3
Markus (顧孟勤)
https://chromiumcodereview.appspot.com/10542028/diff/1/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://chromiumcodereview.appspot.com/10542028/diff/1/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode222 sandbox/linux/seccomp-bpf/sandbox_bpf.cc:222: BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ERRNO + SECCOMP_DENY_ERRNO)); On 2012/06/07 01:02:38, Chris Evans ...
8 years, 6 months ago (2012-06-07 01:33:28 UTC) #4
Chris Evans
8 years, 6 months ago (2012-06-07 23:01:36 UTC) #5
LGTM with one nit.

https://chromiumcodereview.appspot.com/10542028/diff/1003/sandbox/linux/secco...
File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right):

https://chromiumcodereview.appspot.com/10542028/diff/1003/sandbox/linux/secco...
sandbox/linux/seccomp-bpf/sandbox_bpf.cc:236: #if defined(__i386__) ||
defined(__x86_64__)
I'd be tempted to remove this outer conditional. It makes the logic easier to
read, and I don't see any harm on forcing the bit to be clear on e.g. ARM. In
fact we'll probably want this one day for the future ARM64 vs. a32 mode :P

Powered by Google App Engine
This is Rietveld 408576698