diff options
| author | m00nbsd <john.big.sandwich@gmail.com> | 2020-05-19 21:13:37 +0200 |
|---|---|---|
| committer | Andrey Konovalov <andreyknvl@gmail.com> | 2020-05-19 23:07:55 +0200 |
| commit | 67fa1f59b87fed7268b465f7e9540a590a250c65 (patch) | |
| tree | d6d7f3c7975308cdef5aaf8cf4a51f7b9ae6de0c /pkg/host | |
| parent | 8f2ad84be93443ce86dcaa7724cd6d3846b798ad (diff) | |
executor: add support for USB fuzzing on NetBSD
Diffstat (limited to 'pkg/host')
| -rw-r--r-- | pkg/host/host_netbsd.go | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/pkg/host/host_netbsd.go b/pkg/host/host_netbsd.go index 8a8e08de9..4d876f90c 100644 --- a/pkg/host/host_netbsd.go +++ b/pkg/host/host_netbsd.go @@ -4,14 +4,29 @@ package host import ( + "github.com/google/syzkaller/pkg/osutil" "github.com/google/syzkaller/prog" ) func isSupported(c *prog.Syscall, target *prog.Target, sandbox string) (bool, string) { - return true, "" + switch c.CallName { + case "syz_usb_connect", "syz_usb_disconnect": + reason := checkUSBEmulation() + return reason == "", reason + default: + return true, "" + } } func init() { checkFeature[FeatureCoverage] = unconditionallyEnabled checkFeature[FeatureComparisons] = unconditionallyEnabled + checkFeature[FeatureUSBEmulation] = checkUSBEmulation +} + +func checkUSBEmulation() string { + if err := osutil.IsAccessible("/dev/vhci"); err != nil { + return err.Error() + } + return "" } |
