Skip to content

Commit a16fc38

Browse files
nbd168jmberg-intel
authored andcommitted
wifi: mac80211: fix potential null pointer dereference
rx->sta->amsdu_mesh_control is being passed to ieee80211_amsdu_to_8023s without checking rx->sta. Since it doesn't make sense to accept A-MSDU packets without a sta, simply add a check earlier. Fixes: 6e4c0d0 ("wifi: mac80211: add a workaround for receiving non-standard mesh A-MSDU") Signed-off-by: Felix Fietkau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 4d78e03 commit a16fc38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/mac80211/rx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2930,7 +2930,7 @@ __ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx, u8 data_offset)
29302930
data_offset, true))
29312931
return RX_DROP_UNUSABLE;
29322932

2933-
if (rx->sta && rx->sta->amsdu_mesh_control < 0) {
2933+
if (rx->sta->amsdu_mesh_control < 0) {
29342934
bool valid_std = ieee80211_is_valid_amsdu(skb, true);
29352935
bool valid_nonstd = ieee80211_is_valid_amsdu(skb, false);
29362936

@@ -3006,7 +3006,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx)
30063006
}
30073007
}
30083008

3009-
if (is_multicast_ether_addr(hdr->addr1))
3009+
if (is_multicast_ether_addr(hdr->addr1) || !rx->sta)
30103010
return RX_DROP_UNUSABLE;
30113011

30123012
if (rx->key) {

0 commit comments

Comments
 (0)