aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/host/syscalls_linux.go
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2020-04-01 19:37:07 +0200
committerAndrey Konovalov <andreyknvl@gmail.com>2020-04-03 12:42:06 +0200
commit09ff5abc02a0e38bb275a91380fc03d6cd0d47a5 (patch)
treea39602cd91fbad39b6e10a8455b58d7f59831965 /pkg/host/syscalls_linux.go
parentca1beb07f02e67ba2faa81a5b56b061111f818f3 (diff)
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.
Diffstat (limited to 'pkg/host/syscalls_linux.go')
-rw-r--r--pkg/host/syscalls_linux.go4
1 files changed, 2 insertions, 2 deletions
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 {