From 84a66e8e4f8324de38eb230b5e2539570b4d05a5 Mon Sep 17 00:00:00 2001 From: George Kennedy Date: Tue, 13 Sep 2022 15:53:09 +0000 Subject: 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 --- executor/executor.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'executor/executor.cc') diff --git a/executor/executor.cc b/executor/executor.cc index 3c76738d2..efd072a75 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -173,6 +173,7 @@ static bool flag_net_reset; static bool flag_cgroups; static bool flag_close_fds; static bool flag_devlink_pci; +static bool flag_nic_vf; static bool flag_vhci_injection; static bool flag_wifi; static bool flag_delay_kcov_mmap; @@ -621,6 +622,7 @@ void parse_env_flags(uint64 flags) flag_vhci_injection = flags & (1 << 12); flag_wifi = flags & (1 << 13); flag_delay_kcov_mmap = flags & (1 << 14); + flag_nic_vf = flags & (1 << 15); } #if SYZ_EXECUTOR_USES_FORK_SERVER -- cgit mrf-deployment