aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/host/syscalls_linux.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-03-22 12:21:51 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-03-24 08:43:00 +0100
commitef871b2e4ff7b6a8f84a6a0a0fd3e9c3ed8e67b4 (patch)
treeb7cf2e1c4daf6ddab668bb2dd5b9c74a47724647 /pkg/host/syscalls_linux.go
parent8cf47975a6532c9cb87e7c5dbfd462f5299a078b (diff)
sys/linux: don't use syz_open_dev when openat is enough
Diffstat (limited to 'pkg/host/syscalls_linux.go')
-rw-r--r--pkg/host/syscalls_linux.go4
1 files changed, 3 insertions, 1 deletions
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.