aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/host/features.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/features.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/features.go')
-rw-r--r--pkg/host/features.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/host/features.go b/pkg/host/features.go
index 3bc0127b6..707757755 100644
--- a/pkg/host/features.go
+++ b/pkg/host/features.go
@@ -25,6 +25,7 @@ const (
FeatureNetDevices
FeatureKCSAN
FeatureDevlinkPCI
+ FeatureUSBEmulation
numFeatures
)
@@ -62,6 +63,7 @@ func Check(target *prog.Target) (*Features, error) {
FeatureNetDevices: {Name: "net device setup", Reason: unsupported},
FeatureKCSAN: {Name: "concurrency sanitizer", Reason: unsupported},
FeatureDevlinkPCI: {Name: "devlink PCI setup", Reason: unsupported},
+ FeatureUSBEmulation: {Name: "USB emulation", Reason: unsupported},
}
if targets.Get(target.OS, target.Arch).HostFuzzer {
return res, nil
@@ -99,6 +101,9 @@ func Setup(target *prog.Target, features *Features, featureFlags csource.Feature
if features[FeatureKCSAN].Enabled {
args = append(args, "kcsan")
}
+ if features[FeatureUSBEmulation].Enabled {
+ args = append(args, "usb")
+ }
_, err := osutil.RunCmd(time.Minute, "", executor, args...)
return err
}