Skip to content

Commit 7479ae9

Browse files
authored
Merge pull request #561 from vbatts/seccomp_platform
generate/seccomp: platform independent values
2 parents 4794350 + e2fbc1b commit 7479ae9

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

generate/seccomp/seccomp_default.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package seccomp
22

33
import (
44
"runtime"
5-
"syscall"
65

76
"github.com/opencontainers/runtime-spec/specs-go"
87
rspec "github.com/opencontainers/runtime-spec/specs-go"
@@ -513,7 +512,7 @@ func DefaultProfile(rs *specs.Spec) *rspec.LinuxSeccomp {
513512
Args: []rspec.LinuxSeccompArg{
514513
{
515514
Index: sysCloneFlagsIndex,
516-
Value: syscall.CLONE_NEWNS | syscall.CLONE_NEWUTS | syscall.CLONE_NEWIPC | syscall.CLONE_NEWUSER | syscall.CLONE_NEWPID | syscall.CLONE_NEWNET,
515+
Value: CloneNewNS | CloneNewUTS | CloneNewIPC | CloneNewUser | CloneNewPID | CloneNewNet,
517516
ValueTwo: 0,
518517
Op: rspec.OpMaskedEqual,
519518
},
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// +build linux
2+
3+
package seccomp
4+
5+
import "syscall"
6+
7+
// System values passed through on linux
8+
const (
9+
CloneNewIPC = syscall.CLONE_NEWIPC
10+
CloneNewNet = syscall.CLONE_NEWNET
11+
CloneNewNS = syscall.CLONE_NEWNS
12+
CloneNewPID = syscall.CLONE_NEWPID
13+
CloneNewUser = syscall.CLONE_NEWUSER
14+
CloneNewUTS = syscall.CLONE_NEWUTS
15+
)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// +build !linux
2+
3+
package seccomp
4+
5+
// These are copied from linux/amd64 syscall values, as a reference for other
6+
// platforms to have access to
7+
const (
8+
CloneNewIPC = 0x8000000
9+
CloneNewNet = 0x40000000
10+
CloneNewNS = 0x20000
11+
CloneNewPID = 0x20000000
12+
CloneNewUser = 0x10000000
13+
CloneNewUTS = 0x4000000
14+
CloneNewCgroup = 0x02000000
15+
)

0 commit comments

Comments
 (0)