Spaces:
Running
Running
oOraph
commited on
Remove some seccomp deny rules to make it work with cuda (#48)
Browse files
sandbox.c
CHANGED
|
@@ -19,11 +19,17 @@ int main(int argc, char* argv[]) {
|
|
| 19 |
return EXIT_FAILURE;
|
| 20 |
}
|
| 21 |
|
| 22 |
-
// Block network-related syscalls
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
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);
|
| 27 |
seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(accept), 0);
|
| 28 |
seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(send), 0);
|
| 29 |
seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(sendto), 0);
|
|
|
|
| 19 |
return EXIT_FAILURE;
|
| 20 |
}
|
| 21 |
|
| 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 |
+
|
| 32 |
seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(connect), 0);
|
|
|
|
|
|
|
| 33 |
seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(accept), 0);
|
| 34 |
seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(send), 0);
|
| 35 |
seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(sendto), 0);
|