Skip to content

Commit ca5e983

Browse files
committed
Add support for seccomp filter flags
crun supports seccomp filter flags since containers/crun@fefabff runc will get them with opencontainers/runc#3390 youki will get them with youki-dev/youki#733 To support them generally, we now copy the flags during the seccomp setup, otherwise they will get lost. Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
1 parent 194ee74 commit ca5e983

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pkg/seccomp/seccomp_linux.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build seccomp
12
// +build seccomp
23

34
// SPDX-License-Identifier: Apache-2.0
@@ -120,6 +121,10 @@ func setupSeccomp(config *Seccomp, rs *specs.Spec) (*specs.LinuxSeccomp, error)
120121
return nil, err
121122
}
122123

124+
for _, flag := range config.Flags {
125+
newConfig.Flags = append(newConfig.Flags, specs.LinuxSeccompFlag(flag))
126+
}
127+
123128
if len(config.ArchMap) != 0 {
124129
for _, a := range config.ArchMap {
125130
seccompArch, ok := nativeToSeccomp[arch]

pkg/seccomp/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type Seccomp struct {
1717
Architectures []Arch `json:"architectures,omitempty"`
1818
ArchMap []Architecture `json:"archMap,omitempty"`
1919
Syscalls []*Syscall `json:"syscalls"`
20+
Flags []string `json:"flags,omitempty"`
2021
}
2122

2223
// Architecture is used to represent a specific architecture

0 commit comments

Comments
 (0)