Skip to content

Commit a48ddf4

Browse files
Don't allow io_uring related syscalls in the RuntimeDefault seccomp profile.
Signed-off-by: Vinayak Goyal <[email protected]>
1 parent 19ff94b commit a48ddf4

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

contrib/seccomp/seccomp_default.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,6 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
183183
"ioprio_set",
184184
"io_setup",
185185
"io_submit",
186-
"io_uring_enter",
187-
"io_uring_register",
188-
"io_uring_setup",
189186
"ipc",
190187
"kill",
191188
"landlock_add_rule",
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package seccomp
2+
3+
import (
4+
"testing"
5+
6+
"github.com/opencontainers/runtime-spec/specs-go"
7+
)
8+
9+
func TestIOUringIsNotAllowed(t *testing.T) {
10+
11+
disallowed := map[string]bool{
12+
"io_uring_enter": true,
13+
"io_uring_register": true,
14+
"io_uring_setup": true,
15+
}
16+
17+
got := DefaultProfile(&specs.Spec{
18+
Process: &specs.Process{
19+
Capabilities: &specs.LinuxCapabilities{
20+
Bounding: []string{},
21+
},
22+
},
23+
})
24+
25+
for _, config := range got.Syscalls {
26+
if config.Action != specs.ActAllow {
27+
continue
28+
}
29+
30+
for _, name := range config.Names {
31+
if disallowed[name] {
32+
t.Errorf("found disallowed io_uring related syscalls")
33+
}
34+
}
35+
}
36+
}

0 commit comments

Comments
 (0)