From 09ff5abc02a0e38bb275a91380fc03d6cd0d47a5 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Wed, 1 Apr 2020 19:37:07 +0200 Subject: csource, executor: add usb emulation feature The feature gets enabled when /dev/raw-gadget is present and accessible. With this feature enabled, executor will do chmod 0666 /dev/raw-gadget on startup, which makes it possible to do USB fuzzing in setuid and namespace sandboxes. There should be no backwards compatibility issues with syz reproducers that don't explicitly enable this feature, as they currently only work in none sandbox. --- pkg/host/syscalls_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/host/syscalls_linux.go') diff --git a/pkg/host/syscalls_linux.go b/pkg/host/syscalls_linux.go index 693ec3f3e..dd89733c0 100644 --- a/pkg/host/syscalls_linux.go +++ b/pkg/host/syscalls_linux.go @@ -177,7 +177,7 @@ func isSupportedSyzkall(sandbox string, c *prog.Syscall) (bool, string) { if !strings.Contains(fname, "#") { panic(fmt.Sprintf("%v does not contain # in the file name (should be openat)", c.Name)) } - if checkUSBInjection() == "" { + if checkUSBEmulation() == "" { // These entries might not be available at boot time, // but will be created by connected USB devices. USBDevicePrefixes := []string{ @@ -215,7 +215,7 @@ func isSupportedSyzkall(sandbox string, c *prog.Syscall) (bool, string) { return reason == "", reason case "syz_usb_connect", "syz_usb_connect_ath9k", "syz_usb_disconnect", "syz_usb_control_io", "syz_usb_ep_write", "syz_usb_ep_read": - reason := checkUSBInjection() + reason := checkUSBEmulation() return reason == "", reason case "syz_kvm_setup_cpu": switch c.Name { -- cgit mrf-deployment