summaryrefslogtreecommitdiff
path: root/src/common/sandbox.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-09-09 15:37:45 -0400
committerNick Mathewson <nickm@torproject.org>2013-09-09 15:37:45 -0400
commite9ec0cb5506b81f7f7c54e06a95dafac4acb38e3 (patch)
treed157ae8939b6fb34226796faa5a5f60e05f1edf4 /src/common/sandbox.c
parent4e00625bbe030f5c1ae54fb7c4c07dd061ab8644 (diff)
downloadtor-e9ec0cb5506b81f7f7c54e06a95dafac4acb38e3.tar.gz
tor-e9ec0cb5506b81f7f7c54e06a95dafac4acb38e3.zip
Do not try to add non-existent syscalls.
Diffstat (limited to 'src/common/sandbox.c')
-rw-r--r--src/common/sandbox.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index c6c93489c8..a5bc892973 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -1187,10 +1187,12 @@ add_noparam_filter(scmp_filter_ctx ctx)
// add general filters
for (i = 0; i < ARRAY_LENGTH(filter_nopar_gen); i++) {
+ if (filter_nopar_gen[i] < 0)
+ continue;
rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, filter_nopar_gen[i], 0);
if (rc != 0) {
- log_err(LD_BUG,"(Sandbox) failed to add syscall index %d, "
- "received libseccomp error %d", i, rc);
+ log_err(LD_BUG,"(Sandbox) failed to add syscall index %d (NR=%d), "
+ "received libseccomp error %d", i, filter_nopar_gen[i], rc);
return rc;
}
}