aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor.cc
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2020-09-08 08:25:27 +0300
committerDmitry Vyukov <dvyukov@google.com>2020-09-22 10:12:23 +0200
commit9133037195b4eb6ca586ff9fd3810ae3a780b931 (patch)
tree19393a1d33c80f2764670e74b2d8cb685dfba244 /executor/executor.cc
parent1125444eb8aaf143cd81dc90e502a059385e2455 (diff)
all: integrate with mac80211_hwsim
Two virtual wireless devices are instantiated during network devices initialization. A new flag (-wifi) is added that controls whether these virtual wifi devices are instantiated and configured during proc initialization. Also, two new pseudo syscalls are added: 1. syz_80211_inject_frame(mac_addr, packet, packet_len) -- injects an arbitrary packet into the wireless stack. It is injected as if it originated from the device identitied by mac_addr. 2. syz_80211_join_ibss(interface_name, ssid, ssid_len, mode) -- puts a specific network interface into IBSS state and joins an IBSS network. Arguments of syz_80211_join_ibss: 1) interface_name -- null-terminated string that identifies a wireless interface 2) ssid, ssid_len -- SSID of an IBSS network to join to 3) mode -- mode of syz_80211_join_ibss operation (see below) Modes of operation: JOIN_IBSS_NO_SCAN (0x0) -- channel scan is not performed and syz_80211_join_ibss waits until the interface reaches IF_OPER_UP. JOIN_IBSS_BG_SCAN (0x1) -- channel scan is performed (takes ~ 9 seconds), syz_80211_join_ibss does not await IF_OPER_UP. JOIN_IBSS_BG_NO_SCAN (0x2) -- channel scan is not performed, syz_80211_join_ibss does not await IF_OPER_UP. Local testing ensured that these syscalls are indeed able to set up an operating network and inject packets into mac80211.
Diffstat (limited to 'executor/executor.cc')
-rw-r--r--executor/executor.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/executor/executor.cc b/executor/executor.cc
index e63f9b224..92d25e318 100644
--- a/executor/executor.cc
+++ b/executor/executor.cc
@@ -129,6 +129,7 @@ static bool flag_cgroups;
static bool flag_close_fds;
static bool flag_devlink_pci;
static bool flag_vhci_injection;
+static bool flag_wifi;
static bool flag_collect_cover;
static bool flag_dedup_cover;
@@ -492,6 +493,7 @@ void parse_env_flags(uint64 flags)
flag_close_fds = flags & (1 << 10);
flag_devlink_pci = flags & (1 << 11);
flag_vhci_injection = flags & (1 << 12);
+ flag_wifi = flags & (1 << 13);
}
#if SYZ_EXECUTOR_USES_FORK_SERVER