Merge pull request #5982 from AkihiroSuda/clone3
This commit is contained in:
commit
da6b0efccd
@ -50,6 +50,7 @@ func arches() []specs.Arch {
|
|||||||
|
|
||||||
// DefaultProfile defines the allowed syscalls for the default seccomp profile.
|
// DefaultProfile defines the allowed syscalls for the default seccomp profile.
|
||||||
func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
|
func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
|
||||||
|
nosys := uint(unix.ENOSYS)
|
||||||
syscalls := []specs.LinuxSyscall{
|
syscalls := []specs.LinuxSyscall{
|
||||||
{
|
{
|
||||||
Names: []string{
|
Names: []string{
|
||||||
@ -527,6 +528,7 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
|
|||||||
Names: []string{
|
Names: []string{
|
||||||
"bpf",
|
"bpf",
|
||||||
"clone",
|
"clone",
|
||||||
|
"clone3",
|
||||||
"fanotify_init",
|
"fanotify_init",
|
||||||
"fsconfig",
|
"fsconfig",
|
||||||
"fsmount",
|
"fsmount",
|
||||||
@ -658,6 +660,15 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// clone3 is explicitly requested to give ENOSYS instead of the default EPERM, when CAP_SYS_ADMIN is unset
|
||||||
|
// https://github.com/moby/moby/pull/42681
|
||||||
|
s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
|
||||||
|
Names: []string{
|
||||||
|
"clone3",
|
||||||
|
},
|
||||||
|
Action: specs.ActErrno,
|
||||||
|
ErrnoRet: &nosys,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return s
|
return s
|
||||||
|
Loading…
Reference in New Issue
Block a user