diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-05-29 11:04:32 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-05-29 11:04:32 -0400 |
commit | a6688f9cbb930ad139a7f3886684fcadeec59d30 (patch) | |
tree | 52bc7d3237ccffb2ec4d790194f0be32267441cc /src/common/sandbox.c | |
parent | a056ffabbbdc76598830331c6550740a24fadeb8 (diff) | |
download | tor-a6688f9cbb930ad139a7f3886684fcadeec59d30.tar.gz tor-a6688f9cbb930ad139a7f3886684fcadeec59d30.zip |
sandbox: allow enough setsockopt to make ConstrainedSockets work
fixes bug 12139; bugfix on 0.2.5.1-alpha
Diffstat (limited to 'src/common/sandbox.c')
-rw-r--r-- | src/common/sandbox.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/sandbox.c b/src/common/sandbox.c index ba1956b144..c379151b31 100644 --- a/src/common/sandbox.c +++ b/src/common/sandbox.c @@ -587,6 +587,18 @@ sb_setsockopt(scmp_filter_ctx ctx, sandbox_cfg_t *filter) if (rc) return rc; + rc = seccomp_rule_add_2(ctx, SCMP_ACT_ALLOW, SCMP_SYS(setsockopt), + SCMP_CMP(1, SCMP_CMP_EQ, SOL_SOCKET), + SCMP_CMP(2, SCMP_CMP_EQ, SO_SNDBUF)); + if (rc) + return rc; + + rc = seccomp_rule_add_2(ctx, SCMP_ACT_ALLOW, SCMP_SYS(setsockopt), + SCMP_CMP(1, SCMP_CMP_EQ, SOL_SOCKET), + SCMP_CMP(2, SCMP_CMP_EQ, SO_RCVBUF)); + if (rc) + return rc; + #ifdef IP_TRANSPARENT rc = seccomp_rule_add_2(ctx, SCMP_ACT_ALLOW, SCMP_SYS(setsockopt), SCMP_CMP(1, SCMP_CMP_EQ, SOL_IP), |