Skip to content

Commit 19e4a47

Browse files
committed
wifi: mac80211: check S1G action frame size
Before checking the action code, check that it even exists in the frame. Reported-by: [email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 6d2c360 commit 19e4a47

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/mac80211/rx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3732,6 +3732,10 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
37323732
break;
37333733
goto queue;
37343734
case WLAN_CATEGORY_S1G:
3735+
if (len < offsetofend(typeof(*mgmt),
3736+
u.action.u.s1g.action_code))
3737+
break;
3738+
37353739
switch (mgmt->u.action.u.s1g.action_code) {
37363740
case WLAN_S1G_TWT_SETUP:
37373741
case WLAN_S1G_TWT_TEARDOWN:

0 commit comments

Comments
 (0)