Skip to content

Commit 85eaf23

Browse files
committed
seccomp: add support for "swapcontext" syscall in default policy
This system call is only available on the 32- and 64-bit PowerPC, it is used by modern programming language implementations (such as gcc-go) to implement coroutine features through userspace context switches. Other container environment, such as Systemd nspawn already whitelist this system call in their seccomp profile [1] [2]. As such, it would be nice to also whitelist it in moby. This issue was encountered on Alpine Linux GitLab CI system, which uses moby, when attempting to execute gcc-go compiled software on ppc64le. [1]: systemd/systemd#9487 [2]: systemd/systemd#9485 Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
1 parent 10aecb0 commit 85eaf23

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

profiles/seccomp/default.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,8 @@
474474
},
475475
{
476476
"names": [
477-
"sync_file_range2"
477+
"sync_file_range2",
478+
"swapcontext"
478479
],
479480
"action": "SCMP_ACT_ALLOW",
480481
"includes": {

profiles/seccomp/default_linux.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ func DefaultProfile() *Seccomp {
474474
LinuxSyscall: specs.LinuxSyscall{
475475
Names: []string{
476476
"sync_file_range2",
477+
"swapcontext",
477478
},
478479
Action: specs.ActAllow,
479480
},

0 commit comments

Comments
 (0)