diff options
author | Alexander Færøy <ahf@torproject.org> | 2020-06-30 14:19:28 +0000 |
---|---|---|
committer | Alexander Færøy <ahf@torproject.org> | 2020-06-30 14:19:28 +0000 |
commit | 5a38c73f7098e5c7e24198ef71dce140d421efcf (patch) | |
tree | 552252c1096f1959c3f036f975bfed6f2cf0732b /src/lib/sandbox | |
parent | fb46d1bb3488a6deedc7172a58554e0953c7df87 (diff) | |
parent | 2913dbd6d9c1ee53c5a7524dd6693f5a6c6f8293 (diff) | |
download | tor-5a38c73f7098e5c7e24198ef71dce140d421efcf.tar.gz tor-5a38c73f7098e5c7e24198ef71dce140d421efcf.zip |
Merge branch 'tor-github/pr/1887' into maint-0.4.3
Diffstat (limited to 'src/lib/sandbox')
-rw-r--r-- | src/lib/sandbox/sandbox.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/sandbox/sandbox.c b/src/lib/sandbox/sandbox.c index 626a4dc5a5..b917912f4d 100644 --- a/src/lib/sandbox/sandbox.c +++ b/src/lib/sandbox/sandbox.c @@ -266,6 +266,11 @@ static int filter_nopar_gen[] = { SCMP_SYS(listen), SCMP_SYS(connect), SCMP_SYS(getsockname), +#ifdef ENABLE_NSS +#ifdef __NR_getpeername + SCMP_SYS(getpeername), +#endif +#endif SCMP_SYS(recvmsg), SCMP_SYS(recvfrom), SCMP_SYS(sendto), @@ -649,6 +654,15 @@ sb_socket(scmp_filter_ctx ctx, sandbox_cfg_t *filter) } } +#ifdef ENABLE_NSS + rc = seccomp_rule_add_3(ctx, SCMP_ACT_ALLOW, SCMP_SYS(socket), + SCMP_CMP(0, SCMP_CMP_EQ, PF_INET), + SCMP_CMP(1, SCMP_CMP_EQ, SOCK_STREAM), + SCMP_CMP(2, SCMP_CMP_EQ, IPPROTO_IP)); + if (rc) + return rc; +#endif + rc = seccomp_rule_add_3(ctx, SCMP_ACT_ALLOW, SCMP_SYS(socket), SCMP_CMP(0, SCMP_CMP_EQ, PF_UNIX), SCMP_CMP_MASKED(1, SOCK_CLOEXEC|SOCK_NONBLOCK, SOCK_STREAM), |