aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/options_test.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/csource/options_test.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/csource/options_test.go')
-rw-r--r--pkg/csource/options_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/csource/options_test.go b/pkg/csource/options_test.go
index b15783359..d4e1832e7 100644
--- a/pkg/csource/options_test.go
+++ b/pkg/csource/options_test.go
@@ -220,6 +220,7 @@ func TestParseFeaturesFlags(t *testing.T) {
"binfmt_misc": true,
"close_fds": true,
"devlink_pci": true,
+ "usb": true,
}},
{"none", "none", false, map[string]bool{
"tun": false,
@@ -229,6 +230,7 @@ func TestParseFeaturesFlags(t *testing.T) {
"binfmt_misc": false,
"close_fds": false,
"devlink_pci": false,
+ "usb": false,
}},
{"all", "none", true, map[string]bool{
"tun": true,
@@ -238,6 +240,7 @@ func TestParseFeaturesFlags(t *testing.T) {
"binfmt_misc": true,
"close_fds": true,
"devlink_pci": true,
+ "usb": true,
}},
{"", "none", true, map[string]bool{
"tun": false,
@@ -247,6 +250,7 @@ func TestParseFeaturesFlags(t *testing.T) {
"binfmt_misc": false,
"close_fds": false,
"devlink_pci": false,
+ "usb": false,
}},
{"none", "all", true, map[string]bool{
"tun": false,
@@ -256,6 +260,7 @@ func TestParseFeaturesFlags(t *testing.T) {
"binfmt_misc": false,
"close_fds": false,
"devlink_pci": false,
+ "usb": false,
}},
{"none", "", true, map[string]bool{
"tun": true,
@@ -265,6 +270,7 @@ func TestParseFeaturesFlags(t *testing.T) {
"binfmt_misc": true,
"close_fds": true,
"devlink_pci": true,
+ "usb": true,
}},
{"tun,net_dev", "none", true, map[string]bool{
"tun": true,
@@ -274,6 +280,7 @@ func TestParseFeaturesFlags(t *testing.T) {
"binfmt_misc": false,
"close_fds": false,
"devlink_pci": false,
+ "usb": false,
}},
{"none", "cgroups,net_dev", true, map[string]bool{
"tun": true,
@@ -283,6 +290,7 @@ func TestParseFeaturesFlags(t *testing.T) {
"binfmt_misc": true,
"close_fds": true,
"devlink_pci": true,
+ "usb": true,
}},
{"close_fds", "none", true, map[string]bool{
"tun": false,
@@ -292,6 +300,7 @@ func TestParseFeaturesFlags(t *testing.T) {
"binfmt_misc": false,
"close_fds": true,
"devlink_pci": false,
+ "usb": false,
}},
}
for i, test := range tests {