Skip to content

Commit 447fff1

Browse files
authored
Remove some seccomp deny rules to make it work with cuda (#48)
1 parent 0f3d3a5 commit 447fff1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

sandbox.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@ int main(int argc, char* argv[]) {
1919
return EXIT_FAILURE;
2020
}
2121

22-
// Block network-related syscalls
23-
seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(socket), 0);
22+
// Block relevant network-related syscalls, so as to block egress internet access
23+
24+
// We cannot deny these calls as they are needed by cuda
25+
// This should not be a big deal for our use case if what we want is to block egress network access
26+
// (just blocking connect should actually be enough)
27+
28+
// seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(socket), 0);
29+
// seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(bind), 0);
30+
// seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(listen), 0);
31+
2432
seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(connect), 0);
25-
seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(bind), 0);
26-
seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(listen), 0);
2733
seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(accept), 0);
2834
seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(send), 0);
2935
seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(sendto), 0);

0 commit comments

Comments
 (0)