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

Issue 530133003: bpf_dsl: support arbitrary (arg & mask) == val expressions (Closed)

Created:
6 years, 3 months ago by mdempsky
Modified:
6 years, 3 months ago
CC:
chromium-reviews, jln+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

bpf_dsl: support arbitrary (arg & mask) == val expressions Rework the seccomp_bpf compiler internals to work in terms of a single general masked-equality condition instead of the variety of limited condition operators previously supported. All of the peephole optimizations previously applied continue to be supported so similar instructions should be emitted, but the handling of upper/lower words is more cleanly structured now. The old sandbox->Cond() interface continues to be supported for now so that the old seccomp_bpf_unittests continue to give us assurances that the new code generator is still correct. Meanwhile, we provide a new lower-level sandbox->CondMaskedEqual() method that bpf_dsl can now use. BUG=408845 R=jln@chromium.org Committed: https://chromium.googlesource.com/chromium/src/+/2761abc6db37817c1d8df352903d3748bc3048cc

Patch Set 1 #

Patch Set 2 : Add unit test and fix docs #

Patch Set 3 : Push "masked-equality" primitive down into seccomp-bpf layer #

Patch Set 4 : More cleanups/simplifications #

Patch Set 5 : Reorder function definitions slightly #

Total comments: 8

Patch Set 6 : Put all ET_COND sanity checks into SandboxBPF::CondExpression #

Patch Set 7 : Remove unnecessary 'else' blocks #

Patch Set 8 : Respond to jln's comments #

Total comments: 1

Patch Set 9 : Add unit tests to sandbox_bpf_unittest.cc #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+457 lines, -372 lines) Patch
M sandbox/linux/bpf_dsl/bpf_dsl.h View 1 5 chunks +10 lines, -4 lines 0 comments Download
M sandbox/linux/bpf_dsl/bpf_dsl.cc View 1 2 3 4 5 3 chunks +20 lines, -30 lines 0 comments Download
M sandbox/linux/bpf_dsl/bpf_dsl_unittest.cc View 1 3 chunks +12 lines, -0 lines 0 comments Download
M sandbox/linux/seccomp-bpf/errorcode.h View 1 2 3 5 chunks +4 lines, -15 lines 0 comments Download
M sandbox/linux/seccomp-bpf/errorcode.cc View 1 2 3 chunks +8 lines, -11 lines 0 comments Download
M sandbox/linux/seccomp-bpf/sandbox_bpf.h View 1 2 3 4 3 chunks +26 lines, -3 lines 0 comments Download
M sandbox/linux/seccomp-bpf/sandbox_bpf.cc View 1 2 3 4 5 6 7 8 4 chunks +189 lines, -177 lines 1 comment Download
M sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +109 lines, -0 lines 0 comments Download
M sandbox/linux/seccomp-bpf/verifier.cc View 1 2 3 4 5 6 7 3 chunks +79 lines, -132 lines 0 comments Download

Messages

Total messages: 14 (3 generated)
mdempsky
I've skipped implementing most of verifier.cc for OP_MASKED_EQUAL since I'm instead testing the new function ...
6 years, 3 months ago (2014-09-02 23:28:13 UTC) #2
mdempsky
On 2014/09/02 23:28:13, mdempsky wrote: > I've skipped implementing most of verifier.cc for OP_MASKED_EQUAL since ...
6 years, 3 months ago (2014-09-03 15:55:06 UTC) #3
jln (very slow on Chromium)
On 2014/09/03 15:55:06, mdempsky wrote: > On 2014/09/02 23:28:13, mdempsky wrote: > > I've skipped ...
6 years, 3 months ago (2014-09-03 16:09:48 UTC) #4
mdempsky
On 2014/09/03 16:09:48, jln wrote: > Ok, holding off then. Please, ping me! Okay, I ...
6 years, 3 months ago (2014-09-03 19:25:56 UTC) #5
jln (very slow on Chromium)
PS#5 looks pretty good but I'll take a quick look at the newer patchsets as ...
6 years, 3 months ago (2014-09-04 02:08:36 UTC) #6
mdempsky
https://codereview.chromium.org/530133003/diff/80001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc File sandbox/linux/seccomp-bpf/sandbox_bpf.cc (right): https://codereview.chromium.org/530133003/diff/80001/sandbox/linux/seccomp-bpf/sandbox_bpf.cc#newcode920 sandbox/linux/seccomp-bpf/sandbox_bpf.cc:920: // On 32-bit platforms, the upper 32-bits should always ...
6 years, 3 months ago (2014-09-04 17:26:49 UTC) #7
mdempsky
On 2014/09/04 02:08:36, jln wrote: > As mentioned in person, I would also like to ...
6 years, 3 months ago (2014-09-04 17:39:20 UTC) #8
mdempsky
PTAL! On 2014/09/04 02:08:36, jln wrote: > As mentioned in person, I would also like ...
6 years, 3 months ago (2014-09-04 20:50:55 UTC) #9
jln (very slow on Chromium)
lgtm I never quite know what to do about the TP_32BIT / TP_64BIT issue. In ...
6 years, 3 months ago (2014-09-04 21:45:06 UTC) #10
mdempsky
Committed patchset #9 (id:160001) manually as 2761abc (presubmit successful).
6 years, 3 months ago (2014-09-04 21:59:43 UTC) #13
commit-bot: I haz the power
6 years, 3 months ago (2014-09-10 03:33:00 UTC) #14
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/2761abc6db37817c1d8df352903d3748bc3048cc
Cr-Commit-Position: refs/heads/master@{#293347}

Powered by Google App Engine
This is Rietveld 408576698