aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/host/host_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/host/host_linux.go')
-rw-r--r--pkg/host/host_linux.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/host/host_linux.go b/pkg/host/host_linux.go
index e8395511f..88ecf2d5a 100644
--- a/pkg/host/host_linux.go
+++ b/pkg/host/host_linux.go
@@ -201,6 +201,9 @@ func isSupportedSyzkall(sandbox string, c *prog.Syscall) (bool, string) {
case "syz_emit_ethernet", "syz_extract_tcp_res":
reason := checkNetworkInjection()
return reason == "", reason
+ case "syz_usb_connect", "syz_usb_disconnect", "syz_usb_control_io", "syz_usb_ep_write":
+ reason := checkUSBInjection()
+ return reason == "", reason
case "syz_kvm_setup_cpu":
switch c.Name {
case "syz_kvm_setup_cpu$x86":
@@ -634,6 +637,13 @@ func checkNetworkInjection() string {
return checkNetworkDevices()
}
+func checkUSBInjection() string {
+ if err := osutil.IsAccessible("/sys/kernel/debug/usb-fuzzer"); err != nil {
+ return err.Error()
+ }
+ return ""
+}
+
func checkNetworkDevices() string {
if _, err := exec.LookPath("ip"); err != nil {
return "ip command is not found"