From f41f5458bbc99207b2281775e8296ae72cc009fb Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Wed, 5 Jun 2019 18:21:57 +0200 Subject: pkg/host: enable evdev, hidraw and hiddev when USB fuzzing is on --- pkg/host/host_linux.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'pkg/host/host_linux.go') 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, "#") { -- cgit mrf-deployment