diff options
| author | George Kennedy <george.kennedy@oracle.com> | 2022-09-13 15:53:09 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2022-09-21 11:46:22 +0200 |
| commit | 84a66e8e4f8324de38eb230b5e2539570b4d05a5 (patch) | |
| tree | 454fe315bd0db53913128d99516201ac606addf1 /tools | |
| parent | 799171eb67633beabfe4f86022c58de3a796f1b4 (diff) | |
executor: add NIC PCI pass-through VF support
Add support for moving a NIC PCI pass-through VF into Syzkaller's network
namespace so that it will tested. As DEVLINK support is triggered by
setting the pass-through device to "addr=0x10", NIC PCI pass-through VF
support will be triggered by setting the device to "addr=0x11".
If a NIC PCI pass-through VF is detected in do_sandbox, setup a staging
namespace before the fork() and transfer the NIC VF interface to it.
After the fork() and in the child transfer the NIC VF interface to
Syzkaller's network namespace and rename the interface to netpci0 so
that it will be tested.
Signed-off-by: George Kennedy <george.kennedy@oracle.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/syz-execprog/execprog.go | 3 | ||||
| -rw-r--r-- | tools/syz-prog2c/prog2c.go | 1 | ||||
| -rw-r--r-- | tools/syz-reprolist/reprolist.go | 4 | ||||
| -rw-r--r-- | tools/syz-stress/stress.go | 3 |
4 files changed, 11 insertions, 0 deletions
diff --git a/tools/syz-execprog/execprog.go b/tools/syz-execprog/execprog.go index 8b5bd1103..b1d580d96 100644 --- a/tools/syz-execprog/execprog.go +++ b/tools/syz-execprog/execprog.go @@ -355,6 +355,9 @@ func createConfig(target *prog.Target, features *host.Features, featuresFlags cs if featuresFlags["devlink_pci"].Enabled && features[host.FeatureDevlinkPCI].Enabled { config.Flags |= ipc.FlagEnableDevlinkPCI } + if featuresFlags["nic_vf"].Enabled && features[host.FeatureNicVF].Enabled { + config.Flags |= ipc.FlagEnableNicVF + } if featuresFlags["vhci"].Enabled && features[host.FeatureVhciInjection].Enabled { config.Flags |= ipc.FlagEnableVhciInjection } diff --git a/tools/syz-prog2c/prog2c.go b/tools/syz-prog2c/prog2c.go index e7b1ae9b1..1fd5a6218 100644 --- a/tools/syz-prog2c/prog2c.go +++ b/tools/syz-prog2c/prog2c.go @@ -87,6 +87,7 @@ func main() { CloseFDs: features["close_fds"].Enabled, KCSAN: features["kcsan"].Enabled, DevlinkPCI: features["devlink_pci"].Enabled, + NicVF: features["nic_vf"].Enabled, USB: features["usb"].Enabled, VhciInjection: features["vhci"].Enabled, Wifi: features["wifi"].Enabled, diff --git a/tools/syz-reprolist/reprolist.go b/tools/syz-reprolist/reprolist.go index 30cde4f7c..449c1b50b 100644 --- a/tools/syz-reprolist/reprolist.go +++ b/tools/syz-reprolist/reprolist.go @@ -246,6 +246,10 @@ func createProg2CArgs(bug *dashapi.BugReport, opts csource.Options, file string) enable = append(enable, "devlink_pci") flags = append(flags, "-devlinkpci") } + if opts.NicVF { + enable = append(enable, "nic_vf") + flags = append(flags, "-nic_vf") + } if opts.VhciInjection { enable = append(enable, "vhci") flags = append(flags, "-vhci") diff --git a/tools/syz-stress/stress.go b/tools/syz-stress/stress.go index 0b12fc65b..15847df16 100644 --- a/tools/syz-stress/stress.go +++ b/tools/syz-stress/stress.go @@ -168,6 +168,9 @@ func createIPCConfig(target *prog.Target, features *host.Features, featuresFlags if featuresFlags["devlink_pci"].Enabled && features[host.FeatureDevlinkPCI].Enabled { config.Flags |= ipc.FlagEnableDevlinkPCI } + if featuresFlags["nic_vf"].Enabled && features[host.FeatureNicVF].Enabled { + config.Flags |= ipc.FlagEnableNicVF + } if featuresFlags["vhci"].Enabled && features[host.FeatureVhciInjection].Enabled { config.Flags |= ipc.FlagEnableVhciInjection } |
