diff --git a/profiles/seccomp/default.json b/profiles/seccomp/default.json index 2f14e58257..7ec75179ad 100644 --- a/profiles/seccomp/default.json +++ b/profiles/seccomp/default.json @@ -1,5 +1,6 @@ { "defaultAction": "SCMP_ACT_ERRNO", + "defaultErrnoRet": 1, "archMap": [ { "architecture": "SCMP_ARCH_X86_64", diff --git a/profiles/seccomp/default_linux.go b/profiles/seccomp/default_linux.go index 5fa5fe59d2..4c45c242a7 100644 --- a/profiles/seccomp/default_linux.go +++ b/profiles/seccomp/default_linux.go @@ -739,9 +739,11 @@ func DefaultProfile() *Seccomp { }, } + errnoRet := uint(unix.EPERM) return &Seccomp{ LinuxSeccomp: specs.LinuxSeccomp{ - DefaultAction: specs.ActErrno, + DefaultAction: specs.ActErrno, + DefaultErrnoRet: &errnoRet, }, ArchMap: arches(), Syscalls: syscalls, diff --git a/profiles/seccomp/fixtures/example.json b/profiles/seccomp/fixtures/example.json index 21dea414d5..80c5a3152d 100644 --- a/profiles/seccomp/fixtures/example.json +++ b/profiles/seccomp/fixtures/example.json @@ -1,5 +1,6 @@ { "defaultAction": "SCMP_ACT_ERRNO", + "defaultErrnoRet": 1, "syscalls": [ { "name": "clone", diff --git a/profiles/seccomp/seccomp_test.go b/profiles/seccomp/seccomp_test.go index eb4b95cc45..9558d8c58b 100644 --- a/profiles/seccomp/seccomp_test.go +++ b/profiles/seccomp/seccomp_test.go @@ -23,8 +23,10 @@ func TestLoadProfile(t *testing.T) { t.Fatal(err) } var expectedErrno uint = 12345 + var expectedDefaultErrno uint = 1 expected := specs.LinuxSeccomp{ - DefaultAction: specs.ActErrno, + DefaultAction: specs.ActErrno, + DefaultErrnoRet: &expectedDefaultErrno, Syscalls: []specs.LinuxSyscall{ { Names: []string{"clone"},