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/repro/repro.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pkg/repro') diff --git a/pkg/repro/repro.go b/pkg/repro/repro.go index 6de117df6..9c05f34ba 100644 --- a/pkg/repro/repro.go +++ b/pkg/repro/repro.go @@ -844,6 +844,7 @@ var cSimplifies = append(progSimplifies, []Simplify{ opts.BinfmtMisc = false opts.CloseFDs = false opts.DevlinkPCI = false + opts.USB = false return true }, func(opts *csource.Options) bool { @@ -897,6 +898,13 @@ var cSimplifies = append(progSimplifies, []Simplify{ opts.DevlinkPCI = false return true }, + func(opts *csource.Options) bool { + if !opts.USB { + return false + } + opts.USB = false + return true + }, func(opts *csource.Options) bool { if !opts.UseTmpDir || opts.Sandbox == "namespace" || opts.Cgroups { return false -- cgit mrf-deployment