summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-03-26 10:29:29 -0400
committerNick Mathewson <nickm@torproject.org>2018-03-26 10:29:29 -0400
commitb5a6c03998d42147135385f21bd7b85a02385e0f (patch)
tree52caa9d272589270444e29e0362a572fc0ee4732
parent66d3120634ad3daffc3394b05ad5f9ef9716c18a (diff)
parent068d092749508bae84e6d5fce605d2f40c1bdb80 (diff)
downloadtor-b5a6c03998d42147135385f21bd7b85a02385e0f.tar.gz
tor-b5a6c03998d42147135385f21bd7b85a02385e0f.zip
Merge branch 'maint-0.3.1' into maint-0.3.2
-rw-r--r--changes/feature253134
-rw-r--r--src/common/sandbox.c23
2 files changed, 6 insertions, 21 deletions
diff --git a/changes/feature25313 b/changes/feature25313
new file mode 100644
index 0000000000..90f421169f
--- /dev/null
+++ b/changes/feature25313
@@ -0,0 +1,4 @@
+ o Minor features (sandbox):
+ - Explicitly permit the poll() system call when the Linux seccomp2-based
+ sandbox is enabled: apparently, some versions of libc use poll() when
+ calling getpwnam(). Closes ticket 25313.
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index 8827370c24..4bfc2cb363 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -258,7 +258,8 @@ static int filter_nopar_gen[] = {
SCMP_SYS(recvmsg),
SCMP_SYS(recvfrom),
SCMP_SYS(sendto),
- SCMP_SYS(unlink)
+ SCMP_SYS(unlink),
+ SCMP_SYS(poll)
};
/* These macros help avoid the error where the number of filters we add on a
@@ -1070,25 +1071,6 @@ sb_mremap(scmp_filter_ctx ctx, sandbox_cfg_t *filter)
return 0;
}
-/**
- * Function responsible for setting up the poll syscall for
- * the seccomp filter sandbox.
- */
-static int
-sb_poll(scmp_filter_ctx ctx, sandbox_cfg_t *filter)
-{
- int rc = 0;
- (void) filter;
-
- rc = seccomp_rule_add_2(ctx, SCMP_ACT_ALLOW, SCMP_SYS(poll),
- SCMP_CMP(1, SCMP_CMP_EQ, 1),
- SCMP_CMP(2, SCMP_CMP_EQ, 10));
- if (rc)
- return rc;
-
- return 0;
-}
-
#ifdef __NR_stat64
/**
* Function responsible for setting up the stat64 syscall for
@@ -1160,7 +1142,6 @@ static sandbox_filter_func_t filter_func[] = {
sb_flock,
sb_futex,
sb_mremap,
- sb_poll,
#ifdef __NR_stat64
sb_stat64,
#endif