Merge pull request #42649 from kinvolk/rata/seccomp-default-errno
seccomp: Use explicit DefaultErrnoRet
This commit is contained in:
commit
2480bebf59
4 changed files with 8 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"defaultAction": "SCMP_ACT_ERRNO",
|
||||
"defaultErrnoRet": 1,
|
||||
"archMap": [
|
||||
{
|
||||
"architecture": "SCMP_ARCH_X86_64",
|
||||
|
|
|
@ -753,9 +753,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,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"defaultAction": "SCMP_ACT_ERRNO",
|
||||
"defaultErrnoRet": 1,
|
||||
"syscalls": [
|
||||
{
|
||||
"name": "clone",
|
||||
|
|
|
@ -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"},
|
||||
|
|
Loading…
Reference in a new issue