aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/test/80211_setup_station
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2020-10-02 12:05:03 +0300
committerDmitry Vyukov <dvyukov@google.com>2020-10-05 15:05:59 +0200
commit13600d098723ca4567aa380144617e5c1791bbbc (patch)
tree8f383312a5471627aa7f12ebbbaea92bee33e538 /sys/linux/test/80211_setup_station
parentc08b5b69b246ffabf41061b686968f4391146b4b (diff)
sys/linux/test: refactor and extend 802.11 tests
80211_setup_station is extended with frame injections and delays that are arranged in such a way that the device successuflly joins an access point. 80211_scan is a new test that starts a channel scan and then injects a beacon and a probe response. These additions were tested manually and were observed to fulfill their purpose.
Diffstat (limited to 'sys/linux/test/80211_setup_station')
-rw-r--r--sys/linux/test/80211_setup_station28
1 files changed, 22 insertions, 6 deletions
diff --git a/sys/linux/test/80211_setup_station b/sys/linux/test/80211_setup_station
index 19eb83b72..6fb2d0225 100644
--- a/sys/linux/test/80211_setup_station
+++ b/sys/linux/test/80211_setup_station
@@ -1,13 +1,29 @@
# requires: -sandbox=namespace
r0 = socket$nl_generic(0x10, 0x3, 0x10)
-r1 = syz_genetlink_get_family_id$nl80211(&(0x7f0000000200)='nl80211\x00')
-ioctl$sock_SIOCGIFINDEX_80211(r0, 0x8933, &(0x7f0000000700)={'wlan1\x00', <r2=>0x0})
+r1 = syz_genetlink_get_family_id$nl80211(&AUTO='nl80211\x00')
+ioctl$sock_SIOCGIFINDEX_80211(r0, 0x8933, &AUTO={'wlan1\x00', <r2=>0x0})
-# set station mode for wlan1
+# Set station mode for wlan1.
-sendmsg$NL80211_CMD_SET_INTERFACE(r0, &(0x7f0000000340)={0x0, 0x0, &(0x7f0000000300)={&(0x7f0000000240)={AUTO, r1, 0x5, 0x0, 0x0, {{AUTO, AUTO, AUTO}, {@val={AUTO, AUTO, r2, nil}, @void}}, [@NL80211_ATTR_IFTYPE={AUTO, AUTO, 0x2, nil}]}, AUTO}, AUTO, AUTO, AUTO, 0x0}, 0x0)
+sendmsg$NL80211_CMD_SET_INTERFACE(r0, &AUTO={0x0, 0x0, &AUTO={&AUTO={AUTO, r1, 0x5, 0x0, 0x0, {{AUTO, AUTO, AUTO}, {@val={AUTO, AUTO, r2, nil}, @void}}, [@NL80211_ATTR_IFTYPE={AUTO, AUTO, 0x2, nil}]}, AUTO}, AUTO, AUTO, AUTO, 0x0}, 0x0)
-# connect wlan1
+# Connect wlan1.
-sendmsg$NL80211_CMD_CONNECT(r0, &(0x7f0000000340)={0x0, 0x0, &(0x7f0000000300)={&(0x7f0000000240)={AUTO, r1, 0x5, 0x0, 0x0, {{AUTO, AUTO, AUTO}, {@val={AUTO, AUTO, r2, nil},@void}}, [@NL80211_ATTR_SSID={AUTO,AUTO,@default_ap_ssid,nil}, @NL80211_ATTR_MAC={AUTO,AUTO,@from_mac=@device_a,nil}, @NL80211_ATTR_AUTH_TYPE={AUTO, AUTO, 0, nil}, @chandef_params=[@NL80211_ATTR_WIPHY_FREQ={AUTO,AUTO,@default,nil}]]}, AUTO}, AUTO, AUTO, AUTO, 0x0}, 0x0) \ No newline at end of file
+sendmsg$NL80211_CMD_CONNECT(r0, &AUTO={0x0, 0x0, &AUTO={&AUTO={AUTO, r1, 0x5, 0x0, 0x0, {{AUTO, AUTO, AUTO}, {@val={AUTO, AUTO, r2, nil},@void}}, [@NL80211_ATTR_SSID={AUTO,AUTO,@default_ap_ssid,nil}, @NL80211_ATTR_MAC={AUTO,AUTO,@from_mac=@device_a,nil}, @NL80211_ATTR_AUTH_TYPE={AUTO, AUTO, 0, nil}, @chandef_params=[@NL80211_ATTR_WIPHY_FREQ={AUTO,AUTO,@default,nil}]]}, AUTO}, AUTO, AUTO, AUTO, 0x0}, 0x0)
+
+# Inject probe response.
+
+syz_80211_inject_frame(&AUTO=@device_b, &AUTO=@mgmt_frame=@probe_response={@wo_ht={{AUTO, AUTO, AUTO, AUTO, AUTO, 0, 0, 0, 0, AUTO, 0}, {0, 0}, @device_b, @device_a, @from_mac=@device_a, {0,0}}, 0x0, @default, 0x1, @val={AUTO, AUTO, @default_ap_ssid}, @val={AUTO, AUTO, [{0x2,0x1}, {0x4,0x1}, {0xb,0x1}, {0x16,0x1}, {0x0c,0}, {0x12,0x0}, {0x18,0x0}, {0x24,0x0}]}, @void, @void, @void, @void, @void, @void, []}, AUTO)
+
+# Wait 50ms and inject auth response.
+
+nanosleep(&AUTO={0x0,0x2FAF080}, &AUTO={0,0})
+
+syz_80211_inject_frame(&AUTO=@device_b, &AUTO=@mgmt_frame=@auth={@wo_ht={{AUTO, AUTO, AUTO, AUTO, AUTO, 0, 0, 0, 0, AUTO, 0}, {0, 0}, @device_b, @device_a, @from_mac=@device_a, {0,0x1}}, 0x0, 0x2, 0x0, @void, []}, AUTO)
+
+# Wait 50ms and inject association response.
+
+nanosleep(&AUTO={0x0,0x2FAF080}, &AUTO={0,0})
+
+syz_80211_inject_frame(&AUTO=@device_b, &AUTO=@mgmt_frame=@assoc_resp={@wo_ht={{AUTO, AUTO, AUTO, AUTO, AUTO, 0, 0, 0, 0, AUTO, 0}, {0, 0}, @device_b, @device_a, @from_mac=@device_a, {0,0x2}}, 0x1, 0x0, @default, @val={AUTO, AUTO, [{0x2,0x1}, {0x4,0x1}, {0xb,0x1}, {0x16,0x1}, {0x0c,0}, {0x12,0x0}, {0x18,0x0}, {0x24,0x0}]}, @void, []}, AUTO)