Skip to content

Commit

Permalink
Remove some mmap syscall restrictions from the sandbox
Browse files Browse the repository at this point in the history
The new VDSO implementation of `getrandom` can call mmap without `MAP_PRIVATE`; however, just requiring `MAP_ANONYMOUS` should provide enough security on its own.
  • Loading branch information
Popax21 authored Jan 26, 2025
1 parent 5e4df40 commit 1d08e98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tudor-host/src/sandbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static void setup_seccomp() {
cant_fail(seccomp_rule_add(scmp_ctx, SCMP_ACT_ALLOW, SCMP_SYS(gettid), 0));

cant_fail(seccomp_rule_add(scmp_ctx, SCMP_ACT_ALLOW, SCMP_SYS(brk), 0));
cant_fail(seccomp_rule_add(scmp_ctx, SCMP_ACT_ALLOW, SCMP_SYS(mmap), 1, SCMP_A3_32(SCMP_CMP_MASKED_EQ, MAP_PRIVATE | MAP_ANONYMOUS, MAP_PRIVATE | MAP_ANONYMOUS)));
cant_fail(seccomp_rule_add(scmp_ctx, SCMP_ACT_ALLOW, SCMP_SYS(mmap), 1, SCMP_A3_32(SCMP_CMP_MASKED_EQ, MAP_ANONYMOUS, MAP_ANONYMOUS)));
cant_fail(seccomp_rule_add(scmp_ctx, SCMP_ACT_ALLOW, SCMP_SYS(munmap), 0));
cant_fail(seccomp_rule_add(scmp_ctx, SCMP_ACT_ALLOW, SCMP_SYS(mprotect), 0));
cant_fail(seccomp_rule_add(scmp_ctx, SCMP_ACT_ALLOW, SCMP_SYS(madvise), 0));
Expand Down

0 comments on commit 1d08e98

Please sign in to comment.