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

Issue 299743002: Add domain-specific language for BPF policies (Closed)

Created:
6 years, 7 months ago by mdempsky
Modified:
6 years, 5 months ago
CC:
chromium-reviews, agl, jln+watch_chromium.org, Jorge Lucangeli Obes, Robert Sesek, hamaji, Mark Seaborn
Visibility:
Public.

Description

Add domain-specific language for BPF policies This CL adds basic support for equality testing of system call arguments, and conjunctive and disjunctive combinations of tests. BUG=375497 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=283350

Patch Set 1 #

Patch Set 2 : IWYU and whitespace nits #

Patch Set 3 : Mark Impl as const to help guarantee value semantics #

Patch Set 4 : Simplify slightly by making Cond into a typedef #

Total comments: 1

Patch Set 5 : Major overhaul of DSL syntax #

Patch Set 6 : Fix nits in sample policy #

Patch Set 7 : Add newlines #

Patch Set 8 : IWYU #

Patch Set 9 : Cleanup CHECK statements a little bit #

Total comments: 10

Patch Set 10 : Respond to jln feedback #

Total comments: 27

Patch Set 11 : More jln feedback #

Patch Set 12 : Small comment typo #

Patch Set 13 : Add explicit virtual destructors to test policies #

Total comments: 4

Patch Set 14 : Respond to jln feedback #

Patch Set 15 : clang format #

Patch Set 16 : Style nit in example code #

Patch Set 17 : Use build_config.h to detect IA-32 #

Patch Set 18 : Move bpf_dsl into its own top-level directory #

Unified diffs Side-by-side diffs Delta from patch set Stats (+862 lines, -1 line) Patch
M sandbox/linux/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +5 lines, -0 lines 0 comments Download
A + sandbox/linux/bpf_dsl/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +0 lines, -1 line 0 comments Download
A sandbox/linux/bpf_dsl/bpf_dsl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +246 lines, -0 lines 0 comments Download
A sandbox/linux/bpf_dsl/bpf_dsl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +278 lines, -0 lines 0 comments Download
A sandbox/linux/bpf_dsl/bpf_dsl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +248 lines, -0 lines 0 comments Download
A sandbox/linux/bpf_dsl/cons.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +46 lines, -0 lines 0 comments Download
A sandbox/linux/bpf_dsl/cons_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +34 lines, -0 lines 0 comments Download
M sandbox/linux/sandbox_linux.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +3 lines, -0 lines 0 comments Download
M sandbox/linux/sandbox_linux_test_sources.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
mdempsky
As discussed on email, here's my first pass at implementing a DSL for BPF policies. ...
6 years, 7 months ago (2014-05-20 18:50:19 UTC) #1
mdempsky
Julien pointed out we don't actually have that many policies currently, so I went ahead ...
6 years, 7 months ago (2014-05-20 22:21:28 UTC) #2
mdempsky
https://codereview.chromium.org/299743002/diff/60001/sandbox/linux/seccomp-bpf-helpers/bpf_dsl.h File sandbox/linux/seccomp-bpf-helpers/bpf_dsl.h (right): https://codereview.chromium.org/299743002/diff/60001/sandbox/linux/seccomp-bpf-helpers/bpf_dsl.h#newcode21 sandbox/linux/seccomp-bpf-helpers/bpf_dsl.h:21: class CondImpl : public base::RefCounted<CondImpl> { I really want ...
6 years, 7 months ago (2014-05-20 23:26:29 UTC) #3
mdempsky
On 2014/05/20 23:26:29, mdempsky wrote: > Is there a way to workaround this? Is this ...
6 years, 7 months ago (2014-05-20 23:35:05 UTC) #4
mdempsky
jln/jyasskin: FYI, I've largely overhauled the DSL and I think it's much cleaner than before. ...
6 years, 6 months ago (2014-06-02 21:55:37 UTC) #5
mdempsky
I'm toying with the idea of replacing If(condition).Then( result ).ElseIf(condition2).Then( result2 ).Else( result3 ); with ...
6 years, 6 months ago (2014-06-05 17:41:49 UTC) #6
jln (very slow on Chromium)
High level review: this looks great. I still need to look a bit deeper, but ...
6 years, 6 months ago (2014-06-24 00:03:52 UTC) #7
mdempsky
https://chromiumcodereview.appspot.com/299743002/diff/160001/sandbox/linux/sandbox_linux.gypi File sandbox/linux/sandbox_linux.gypi (right): https://chromiumcodereview.appspot.com/299743002/diff/160001/sandbox/linux/sandbox_linux.gypi#newcode161 sandbox/linux/sandbox_linux.gypi:161: 'seccomp-bpf-helpers/bpf_dsl.cc', On 2014/06/24 00:03:52, jln wrote: > Add to ...
6 years, 6 months ago (2014-06-24 00:55:40 UTC) #8
jln (very slow on Chromium)
Sending a few comments that are ready. On top of that, as mentioned in person, ...
6 years, 6 months ago (2014-06-24 23:51:31 UTC) #9
jln (very slow on Chromium)
https://chromiumcodereview.appspot.com/299743002/diff/180001/sandbox/linux/seccomp-bpf-helpers/bpf_dsl_unittest.cc File sandbox/linux/seccomp-bpf-helpers/bpf_dsl_unittest.cc (right): https://chromiumcodereview.appspot.com/299743002/diff/180001/sandbox/linux/seccomp-bpf-helpers/bpf_dsl_unittest.cc#newcode38 sandbox/linux/seccomp-bpf-helpers/bpf_dsl_unittest.cc:38: BPF_TEST_C(BPFDSL, Basic, BasicPolicy) { Let's set errno to 0 ...
6 years, 6 months ago (2014-06-25 00:14:54 UTC) #10
mdempsky
https://codereview.chromium.org/299743002/diff/180001/sandbox/linux/seccomp-bpf-helpers/bpf_dsl.cc File sandbox/linux/seccomp-bpf-helpers/bpf_dsl.cc (right): https://codereview.chromium.org/299743002/diff/180001/sandbox/linux/seccomp-bpf-helpers/bpf_dsl.cc#newcode158 sandbox/linux/seccomp-bpf-helpers/bpf_dsl.cc:158: struct IfThen : public base::RefCounted<IfThen> { On 2014/06/24 23:51:31, ...
6 years, 6 months ago (2014-06-25 23:50:22 UTC) #11
jln (very slow on Chromium)
lgtm, but be careful about IA32 compilation. - I would love if Jeffrey could glance ...
6 years, 6 months ago (2014-06-27 01:45:50 UTC) #12
mdempsky
https://codereview.chromium.org/299743002/diff/240001/sandbox/linux/seccomp-bpf-helpers/bpf_dsl_unittest.cc File sandbox/linux/seccomp-bpf-helpers/bpf_dsl_unittest.cc (right): https://codereview.chromium.org/299743002/diff/240001/sandbox/linux/seccomp-bpf-helpers/bpf_dsl_unittest.cc#newcode58 sandbox/linux/seccomp-bpf-helpers/bpf_dsl_unittest.cc:58: if (sysno == __NR_socketpair) { On 2014/06/27 01:45:50, jln ...
6 years, 5 months ago (2014-06-28 00:36:42 UTC) #13
mdempsky
Jeffrey: Do you think you'll want/have time to review this before I submit it?
6 years, 5 months ago (2014-06-28 00:37:15 UTC) #14
Jeffrey Yasskin
I don't expect to have a chance to do a general review. I can answer ...
6 years, 5 months ago (2014-06-28 00:56:04 UTC) #15
jln (very slow on Chromium)
PS#15 lgtm
6 years, 5 months ago (2014-06-28 01:02:11 UTC) #16
mdempsky
Moved to sandbox/linux/bpf_dsl.
6 years, 5 months ago (2014-07-15 19:20:28 UTC) #17
mdempsky
The CQ bit was checked by mdempsky@chromium.org
6 years, 5 months ago (2014-07-15 19:20:32 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mdempsky@chromium.org/299743002/330001
6 years, 5 months ago (2014-07-15 19:24:01 UTC) #19
commit-bot: I haz the power
Change committed as 283350
6 years, 5 months ago (2014-07-16 05:11:13 UTC) #20
tapted
A revert of this CL has been created in https://codereview.chromium.org/391043003/ by tapted@chromium.org. The reason for ...
6 years, 5 months ago (2014-07-16 06:57:40 UTC) #21
jln (very slow on Chromium)
linux_rel_precise32 can reproduce the failure.
6 years, 5 months ago (2014-07-16 17:06:15 UTC) #22
mdempsky
6 years, 5 months ago (2014-07-16 17:23:32 UTC) #23
Message was sent while issue was closed.
On 2014/07/16 17:06:15, jln wrote:
> linux_rel_precise32 can reproduce the failure.

Thanks.  I'm wondering if glibc does something odd on x86 and wraps those system
calls somehow?  Maybe I should directly call the underlying system calls (e.g.,
via syscall() or LSS) to remove an unknown?

Powered by Google App Engine
This is Rietveld 408576698