aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-08-08 09:26:23 -0400
committerNick Mathewson <nickm@torproject.org>2018-08-08 09:26:23 -0400
commit00536254b765900127af04f278ed591d562434d9 (patch)
treea4727e8b9d7e2bd30948ec39e1ecef22630e0666
parent2a6c1585b0f13e03eb7e8b8977d56a5cea8b4ce8 (diff)
parent8e68fe7e1c84e4ad513cd6b0af686a51c49e55cb (diff)
downloadtor-00536254b765900127af04f278ed591d562434d9.tar.gz
tor-00536254b765900127af04f278ed591d562434d9.zip
Merge branch 'maint-0.3.2' into maint-0.3.3
-rw-r--r--changes/bug254405
-rw-r--r--src/common/sandbox.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/changes/bug25440 b/changes/bug25440
new file mode 100644
index 0000000000..f8d9dd4fab
--- /dev/null
+++ b/changes/bug25440
@@ -0,0 +1,5 @@
+ o Minor bugfixes (linux seccomp2 sandbox):
+ - Fix a bug in out sandboxing rules for the openat() syscall.
+ Previously, no openat() call would be permitted, which would break
+ filesystem operations on recent glibc versions. Fixes bug 25440;
+ bugfix on 0.2.9.15. Diagnosis and patch from Daniel Pinto.
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index 440f8722f2..ca7803ac9c 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -450,7 +450,7 @@ allow_file_open(scmp_filter_ctx ctx, int use_openat, const char *file)
{
if (use_openat) {
return seccomp_rule_add_2(ctx, SCMP_ACT_ALLOW, SCMP_SYS(openat),
- SCMP_CMP_STR(0, SCMP_CMP_EQ, AT_FDCWD),
+ SCMP_CMP(0, SCMP_CMP_EQ, (unsigned int)AT_FDCWD),
SCMP_CMP_STR(1, SCMP_CMP_EQ, file));
} else {
return seccomp_rule_add_1(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open),