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

Issue 10536048: Instead of outputting one BPF check per possible system call. Coalesce (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

Instead of outputting one BPF check per possible system call coalesce all system calls that are supposed to be treated identically. This change list depends on https://chromiumcodereview.appspot.com/10546041/ These changes should address the immediate concerns about inefficient BPF evaluation of system calls. But they are only the first step in the process of us generating an optimal BPF program. We are still missing the compilation of the binary search tree. That is going to be the next change list in this series. But for the benefit of better reviewability, I split the changes into two parts. BUG=130662 TEST=make && demo32 && demo64 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=142295

Patch Set 1 #

Patch Set 2 : Rebased #

Patch Set 3 : Does this result in easier-to-read diffs? #

Total comments: 7

Patch Set 4 : Added more asserts and tweak the existing ones a little bit #

Total comments: 3

Patch Set 5 : Simplified the asserts #

Total comments: 4

Patch Set 6 : Moved checking of policies into a separate method #

Total comments: 6

Patch Set 7 : Rebased #

Patch Set 8 : Rebase #

Patch Set 9 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+177 lines, -53 lines) Patch
M sandbox/linux/seccomp-bpf/sandbox_bpf.h View 1 2 3 4 5 6 7 8 5 chunks +22 lines, -5 lines 0 comments Download
M sandbox/linux/seccomp-bpf/sandbox_bpf.cc View 1 2 3 4 5 6 7 8 3 chunks +153 lines, -46 lines 0 comments Download
M sandbox/linux/seccomp-bpf/verifier.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
Markus (顧孟勤)
This change list currently includes the changes from https://chromiumcodereview.appspot.com/10546041/ Please review the former change list ...
8 years, 6 months ago (2012-06-07 08:32:40 UTC) #1
jln (very slow on Chromium)
Do you mind rebasing it on top of the verifier branch? When doing "git cl ...
8 years, 6 months ago (2012-06-08 19:34:48 UTC) #2
Markus (顧孟勤)
Thanks. I was looking for something like that :-) Yes, I think, this is a ...
8 years, 6 months ago (2012-06-08 19:52:34 UTC) #3
jln (very slow on Chromium)
Looks ok in general, but please make it easier to review for correctness in the ...
8 years, 6 months ago (2012-06-08 22:38:21 UTC) #4
Markus (顧孟勤)
PTAL https://chromiumcodereview.appspot.com/10536048/diff/5001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://chromiumcodereview.appspot.com/10536048/diff/5001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode302 sandbox/linux/seccomp-bpf/sandbox_bpf.cc:302: if (oldErr != evaluateSyscall(std::numeric_limits<int>::max()) || This is just ...
8 years, 6 months ago (2012-06-09 00:30:58 UTC) #5
jln (very slow on Chromium)
https://chromiumcodereview.appspot.com/10536048/diff/9001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://chromiumcodereview.appspot.com/10536048/diff/9001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode186 sandbox/linux/seccomp-bpf/sandbox_bpf.cc:186: void Sandbox::setSandboxPolicy(EvaluateSyscall syscallEvaluator, Let's return a bool (and error ...
8 years, 6 months ago (2012-06-09 01:06:13 UTC) #6
Markus (顧孟勤)
I decided to simplify the sanity checks. The earlier version of the change list was ...
8 years, 6 months ago (2012-06-09 01:41:45 UTC) #7
jln (very slow on Chromium)
LGTM
8 years, 6 months ago (2012-06-11 19:10:00 UTC) #8
Jorge Lucangeli Obes
https://chromiumcodereview.appspot.com/10536048/diff/8007/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://chromiumcodereview.appspot.com/10536048/diff/8007/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode225 sandbox/linux/seccomp-bpf/sandbox_bpf.cc:225: Since this method is called "setSandboxPolicy", doesn't it make ...
8 years, 6 months ago (2012-06-11 19:39:10 UTC) #9
Chris Evans
On Mon, Jun 11, 2012 at 12:39 PM, <jorgelo@chromium.org> wrote: > > https://chromiumcodereview.**appspot.com/10536048/diff/** > 8007/sandbox/linux/seccomp-**bpf/sandbox_bpf.cc<https://chromiumcodereview.appspot.com/10536048/diff/8007/sandbox/linux/seccomp-bpf/sandbox_bpf.cc> ...
8 years, 6 months ago (2012-06-11 19:48:30 UTC) #10
Markus (顧孟勤)
https://chromiumcodereview.appspot.com/10536048/diff/8007/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://chromiumcodereview.appspot.com/10536048/diff/8007/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode225 sandbox/linux/seccomp-bpf/sandbox_bpf.cc:225: On 2012/06/11 19:39:10, Jorge Lucangeli Obes wrote: > Since ...
8 years, 6 months ago (2012-06-11 19:56:50 UTC) #11
Jorge Lucangeli Obes
On 2012/06/11 19:56:50, Markus (顧孟勤) wrote: > https://chromiumcodereview.appspot.com/10536048/diff/8007/sandbox/linux/seccomp-bpf/sandbox_bpf.cc > File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): > > https://chromiumcodereview.appspot.com/10536048/diff/8007/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode225 ...
8 years, 6 months ago (2012-06-11 21:23:34 UTC) #12
Markus (顧孟勤)
I am not surprised that the mere fact that we are using BPF filters adds ...
8 years, 6 months ago (2012-06-12 00:30:10 UTC) #13
Chris Evans
LGTM if you move the policy sanity check to debug-only https://chromiumcodereview.appspot.com/10536048/diff/13001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://chromiumcodereview.appspot.com/10536048/diff/13001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode187 ...
8 years, 6 months ago (2012-06-12 18:11:55 UTC) #14
Chris Evans
https://chromiumcodereview.appspot.com/10536048/diff/13001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://chromiumcodereview.appspot.com/10536048/diff/13001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode314 sandbox/linux/seccomp-bpf/sandbox_bpf.cc:314: // There is really nothing the caller can do ...
8 years, 6 months ago (2012-06-12 18:13:47 UTC) #15
jln (very slow on Chromium)
On Tue, Jun 12, 2012 at 11:11 AM, <cevans@chromium.org> wrote: > LGTM if you move ...
8 years, 6 months ago (2012-06-12 18:18:59 UTC) #16
Markus (顧孟勤)
https://chromiumcodereview.appspot.com/10536048/diff/13001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://chromiumcodereview.appspot.com/10536048/diff/13001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode187 sandbox/linux/seccomp-bpf/sandbox_bpf.cc:187: EvaluateArguments argumentEvaluator) { On 2012/06/12 18:11:55, Chris Evans wrote: ...
8 years, 6 months ago (2012-06-12 19:02:59 UTC) #17
cevans
LGTM On Tue, Jun 12, 2012 at 12:02 PM, <markus@chromium.org> wrote: > > https://chromiumcodereview.**appspot.com/10536048/diff/** > ...
8 years, 6 months ago (2012-06-12 19:12:10 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/markus@chromium.org/10536048/5004
8 years, 6 months ago (2012-06-14 23:23:10 UTC) #19
commit-bot: I haz the power
8 years, 6 months ago (2012-06-15 00:50:14 UTC) #20
Change committed as 142295

Powered by Google App Engine
This is Rietveld 408576698