diff options
| author | Andrey Konovalov <andreyknvl@google.com> | 2020-04-01 19:37:07 +0200 |
|---|---|---|
| committer | Andrey Konovalov <andreyknvl@gmail.com> | 2020-04-03 12:42:06 +0200 |
| commit | 09ff5abc02a0e38bb275a91380fc03d6cd0d47a5 (patch) | |
| tree | a39602cd91fbad39b6e10a8455b58d7f59831965 /executor/common_linux.h | |
| parent | ca1beb07f02e67ba2faa81a5b56b061111f818f3 (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 'executor/common_linux.h')
| -rw-r--r-- | executor/common_linux.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h index 30b6309c9..772d98c03 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -3514,3 +3514,11 @@ static void setup_kcsan_filterlist(char** frames, int nframes, bool blacklist) #define SYZ_HAVE_KCSAN 1 #endif #endif + +#if SYZ_EXECUTOR || SYZ_USB +static void setup_usb() +{ + if (chmod("/dev/raw-gadget", 0666)) + fail("failed to chmod /dev/raw-gadget"); +} +#endif |
