summaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2023-08-15 17:51:05 +0200
committerJohannes Berg <johannes.berg@intel.com>2023-08-22 14:01:18 +0200
commit19e4a47ee74718a22e963e8a647c8c3bfe8bb05c (patch)
treed813800bb6894b43b4c0985575d5baf8515b85c6 /net/mac80211
parentwifi: iwlmei: don't send nic info with invalid mac address (diff)
downloadlinux-19e4a47ee74718a22e963e8a647c8c3bfe8bb05c.tar.xz
linux-19e4a47ee74718a22e963e8a647c8c3bfe8bb05c.zip
wifi: mac80211: check S1G action frame size
Before checking the action code, check that it even exists in the frame. Reported-by: syzbot+be9c824e6f269d608288@syzkaller.appspotmail.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/rx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 4f707d2a160f..33f9764b94de 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -3732,6 +3732,10 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
break;
goto queue;
case WLAN_CATEGORY_S1G:
+ if (len < offsetofend(typeof(*mgmt),
+ u.action.u.s1g.action_code))
+ break;
+
switch (mgmt->u.action.u.s1g.action_code) {
case WLAN_S1G_TWT_SETUP:
case WLAN_S1G_TWT_TEARDOWN: