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

Issue 1302043002: sandbox/linux: refactor bpf_dsl dependency on die.h (Closed)

Created:
5 years, 4 months ago by mdempsky
Modified:
5 years, 4 months ago
CC:
chromium-reviews, rickyz+watch_chromium.org, jln+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

sandbox/linux: refactor bpf_dsl dependency on die.h This CL changes the bpf_dsl "Kill" builtin function to simply map to SECCOMP_RET_KILL, rather than to a trap handler. Additionally, it changes the default PolicyCompiler behavior for handling impossible conditions to use this behavior. However, it also adds SetPanicFunc as a way to override this default behavior, and SandboxBPF uses this to maintain Chrome's historical behavior of printing an error message with SANDBOX_DIE. Arguably the Policy object should actually be responsible for providing a Panic function, but that change will require modifying existing Policy classes elsewhere in the Chromium source tree, so I'll look into that in a followup CL. BUG=449357 Committed: https://crrev.com/e7883acd4d078cc668d639f2a98c02b2cd106335 Cr-Commit-Position: refs/heads/master@{#344574}

Patch Set 1 #

Patch Set 2 : Use logging.h instead of errx #

Total comments: 2

Patch Set 3 : Change default panic behavior to simply Kill #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -25 lines) Patch
M sandbox/linux/bpf_dsl/bpf_dsl.h View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M sandbox/linux/bpf_dsl/bpf_dsl.cc View 1 2 3 chunks +18 lines, -7 lines 0 comments Download
M sandbox/linux/bpf_dsl/bpf_dsl_unittest.cc View 1 2 3 chunks +7 lines, -3 lines 0 comments Download
M sandbox/linux/bpf_dsl/policy_compiler.h View 1 2 4 chunks +10 lines, -0 lines 0 comments Download
M sandbox/linux/bpf_dsl/policy_compiler.cc View 1 2 6 chunks +14 lines, -5 lines 0 comments Download
M sandbox/linux/bpf_dsl/verifier.cc View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M sandbox/linux/seccomp-bpf/errorcode.h View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M sandbox/linux/seccomp-bpf/errorcode.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M sandbox/linux/seccomp-bpf/sandbox_bpf.cc View 1 2 3 chunks +10 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 15 (4 generated)
mdempsky
5 years, 4 months ago (2015-08-19 22:51:50 UTC) #2
rickyz (no longer on Chrome)
https://codereview.chromium.org/1302043002/diff/20001/sandbox/linux/bpf_dsl/policy_compiler.cc File sandbox/linux/bpf_dsl/policy_compiler.cc (right): https://codereview.chromium.org/1302043002/diff/20001/sandbox/linux/bpf_dsl/policy_compiler.cc#newcode61 sandbox/linux/bpf_dsl/policy_compiler.cc:61: LOG(FATAL) << "bpf_dsl panic: " << reinterpret_cast<const char*>(aux); Should ...
5 years, 4 months ago (2015-08-19 23:25:10 UTC) #3
mdempsky
https://codereview.chromium.org/1302043002/diff/20001/sandbox/linux/bpf_dsl/policy_compiler.cc File sandbox/linux/bpf_dsl/policy_compiler.cc (right): https://codereview.chromium.org/1302043002/diff/20001/sandbox/linux/bpf_dsl/policy_compiler.cc#newcode61 sandbox/linux/bpf_dsl/policy_compiler.cc:61: LOG(FATAL) << "bpf_dsl panic: " << reinterpret_cast<const char*>(aux); On ...
5 years, 4 months ago (2015-08-19 23:33:31 UTC) #4
mdempsky
rickyz: PTAL Slightly simpler solution just using SECCOMP_RET_KILL by default instead of a trap handler.
5 years, 4 months ago (2015-08-20 16:19:58 UTC) #5
rickyz (no longer on Chrome)
lgtm Oh oops, I should have read the CL description more carefully - SECCOMP_RET_KILL looks ...
5 years, 4 months ago (2015-08-20 17:55:26 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1302043002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1302043002/40001
5 years, 4 months ago (2015-08-20 17:56:50 UTC) #8
mdempsky
On 2015/08/20 17:55:26, rickyz wrote: > Oh oops, I should have read the CL description ...
5 years, 4 months ago (2015-08-20 18:03:40 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/42399)
5 years, 4 months ago (2015-08-20 18:54:49 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1302043002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1302043002/40001
5 years, 4 months ago (2015-08-20 19:26:14 UTC) #13
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 4 months ago (2015-08-20 20:17:54 UTC) #14
commit-bot: I haz the power
5 years, 4 months ago (2015-08-20 20:18:49 UTC) #15
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/e7883acd4d078cc668d639f2a98c02b2cd106335
Cr-Commit-Position: refs/heads/master@{#344574}

Powered by Google App Engine
This is Rietveld 408576698