Merge pull request #9320 from vinayakankugoyal/io_uring
Don't allow io_uring related syscalls in the RuntimeDefault seccomp profile.
This commit is contained in:
commit
cb742b5dff
@ -183,9 +183,6 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
|
|||||||
"ioprio_set",
|
"ioprio_set",
|
||||||
"io_setup",
|
"io_setup",
|
||||||
"io_submit",
|
"io_submit",
|
||||||
"io_uring_enter",
|
|
||||||
"io_uring_register",
|
|
||||||
"io_uring_setup",
|
|
||||||
"ipc",
|
"ipc",
|
||||||
"kill",
|
"kill",
|
||||||
"landlock_add_rule",
|
"landlock_add_rule",
|
||||||
|
36
contrib/seccomp/seccomp_default_test.go
Normal file
36
contrib/seccomp/seccomp_default_test.go
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package seccomp
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/opencontainers/runtime-spec/specs-go"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestIOUringIsNotAllowed(t *testing.T) {
|
||||||
|
|
||||||
|
disallowed := map[string]bool{
|
||||||
|
"io_uring_enter": true,
|
||||||
|
"io_uring_register": true,
|
||||||
|
"io_uring_setup": true,
|
||||||
|
}
|
||||||
|
|
||||||
|
got := DefaultProfile(&specs.Spec{
|
||||||
|
Process: &specs.Process{
|
||||||
|
Capabilities: &specs.LinuxCapabilities{
|
||||||
|
Bounding: []string{},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
for _, config := range got.Syscalls {
|
||||||
|
if config.Action != specs.ActAllow {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, name := range config.Names {
|
||||||
|
if disallowed[name] {
|
||||||
|
t.Errorf("found disallowed io_uring related syscalls")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user