File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ func arches() []specs.Arch {
4949
5050// DefaultProfile defines the allowed syscalls for the default seccomp profile.
5151func DefaultProfile (sp * specs.Spec ) * specs.LinuxSeccomp {
52+ nosys := uint (unix .ENOSYS )
5253 syscalls := []specs.LinuxSyscall {
5354 {
5455 Names : []string {
@@ -526,6 +527,7 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
526527 Names : []string {
527528 "bpf" ,
528529 "clone" ,
530+ "clone3" ,
529531 "fanotify_init" ,
530532 "fsconfig" ,
531533 "fsmount" ,
@@ -657,6 +659,15 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
657659 },
658660 })
659661 }
662+ // clone3 is explicitly requested to give ENOSYS instead of the default EPERM, when CAP_SYS_ADMIN is unset
663+ // https://github.com/moby/moby/pull/42681
664+ s .Syscalls = append (s .Syscalls , specs.LinuxSyscall {
665+ Names : []string {
666+ "clone3" ,
667+ },
668+ Action : specs .ActErrno ,
669+ ErrnoRet : & nosys ,
670+ })
660671 }
661672
662673 return s
You can’t perform that action at this time.
0 commit comments