diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-07-13 09:16:59 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-07-13 09:16:59 -0400 |
commit | bb731ca665672c97aec7451921688381a2c8e9cb (patch) | |
tree | 4ec5f619fe45417d37b4327b73b663d9c1112d96 /src/common/sandbox.c | |
parent | a931d157fd5454f679614e0a210144552ecabadf (diff) | |
parent | 20e89453fde13ef154b69674255b905dc2b85fd7 (diff) | |
download | tor-bb731ca665672c97aec7451921688381a2c8e9cb.tar.gz tor-bb731ca665672c97aec7451921688381a2c8e9cb.zip |
Merge remote-tracking branch 'Jigsaw52/seccomp-fix-18397' into maint-0.2.8
Diffstat (limited to 'src/common/sandbox.c')
-rw-r--r-- | src/common/sandbox.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/common/sandbox.c b/src/common/sandbox.c index 70c5bbd07c..c0b994b3e8 100644 --- a/src/common/sandbox.c +++ b/src/common/sandbox.c @@ -212,6 +212,10 @@ static int filter_nopar_gen[] = { SCMP_SYS(getrandom), #endif +#ifdef __NR_sysinfo + // qsort uses this.. + SCMP_SYS(sysinfo), +#endif /* * These socket syscalls are not required on x86_64 and not supported with * some libseccomp versions (eg: 1.0.1) @@ -701,6 +705,14 @@ sb_setsockopt(scmp_filter_ctx ctx, sandbox_cfg_t *filter) if (rc) return rc; +#ifdef HAVE_SYSTEMD + 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_SNDBUFFORCE)); + if (rc) + return rc; +#endif + #ifdef IP_TRANSPARENT rc = seccomp_rule_add_2(ctx, SCMP_ACT_ALLOW, SCMP_SYS(setsockopt), SCMP_CMP(1, SCMP_CMP_EQ, SOL_IP), @@ -734,6 +746,14 @@ sb_getsockopt(scmp_filter_ctx ctx, sandbox_cfg_t *filter) if (rc) return rc; +#ifdef HAVE_SYSTEMD + rc = seccomp_rule_add_2(ctx, SCMP_ACT_ALLOW, SCMP_SYS(getsockopt), + SCMP_CMP(1, SCMP_CMP_EQ, SOL_SOCKET), + SCMP_CMP(2, SCMP_CMP_EQ, SO_SNDBUF)); + if (rc) + return rc; +#endif + #ifdef HAVE_LINUX_NETFILTER_IPV4_H rc = seccomp_rule_add_2(ctx, SCMP_ACT_ALLOW, SCMP_SYS(getsockopt), SCMP_CMP(1, SCMP_CMP_EQ, SOL_IP), |