From ef871b2e4ff7b6a8f84a6a0a0fd3e9c3ed8e67b4 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 22 Mar 2020 12:21:51 +0100 Subject: sys/linux: don't use syz_open_dev when openat is enough --- pkg/host/syscalls_linux.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkg/host/syscalls_linux.go') diff --git a/pkg/host/syscalls_linux.go b/pkg/host/syscalls_linux.go index 079a4503d..693ec3f3e 100644 --- a/pkg/host/syscalls_linux.go +++ b/pkg/host/syscalls_linux.go @@ -168,13 +168,15 @@ func isSupportedSyzkall(sandbox string, c *prog.Syscall) (bool, string) { case "syz_open_dev": if _, ok := c.Args[0].(*prog.ConstType); ok { // This is for syz_open_dev$char/block. - // They are currently commented out, but in case one enables them. return true, "" } fname, ok := extractStringConst(c.Args[0]) if !ok { panic("first open arg is not a pointer to string const") } + if !strings.Contains(fname, "#") { + panic(fmt.Sprintf("%v does not contain # in the file name (should be openat)", c.Name)) + } if checkUSBInjection() == "" { // These entries might not be available at boot time, // but will be created by connected USB devices. -- cgit mrf-deployment