Descriptionbpf_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
Messages
Total messages: 14 (3 generated)
|