aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/host/host_linux.go
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2019-06-05 18:21:57 +0200
committerDmitry Vyukov <dvyukov@google.com>2019-06-06 09:26:18 +0200
commitf41f5458bbc99207b2281775e8296ae72cc009fb (patch)
tree7f4f63680a30d7bc0eb6ea5671edce16924668fe /pkg/host/host_linux.go
parent73a7d55bdf43a80ff14a024c9e2440b3e0481e30 (diff)
pkg/host: enable evdev, hidraw and hiddev when USB fuzzing is on
Diffstat (limited to 'pkg/host/host_linux.go')
-rw-r--r--pkg/host/host_linux.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/host/host_linux.go b/pkg/host/host_linux.go
index d0c3cd0f4..67ca37047 100644
--- a/pkg/host/host_linux.go
+++ b/pkg/host/host_linux.go
@@ -178,6 +178,18 @@ func isSupportedSyzkall(sandbox string, c *prog.Syscall) (bool, string) {
if !ok {
panic("first open arg is not a pointer to string const")
}
+ if checkUSBInjection() == "" {
+ // These entries might not be available at boot time,
+ // but will be created by connected USB devices.
+ USBDevicePrefixes := []string{
+ "/dev/hidraw", "/dev/usb/hiddev", "/dev/input/",
+ }
+ for _, prefix := range USBDevicePrefixes {
+ if strings.HasPrefix(fname, prefix) {
+ return true, ""
+ }
+ }
+ }
var check func(dev string) bool
check = func(dev string) bool {
if !strings.Contains(dev, "#") {