Skip to content

Commit 54f9ab7

Browse files
Dan CarpenterKalle Valo
authored andcommitted
ath6kl: prevent potential array overflow in ath6kl_add_new_sta()
The value for "aid" comes from skb->data so Smatch marks it as untrusted. If it's invalid then it can result in an out of bounds array access in ath6kl_add_new_sta(). Fixes: 572e27c ("ath6kl: Fix AP mode connect event parsing and TIM updates") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/20200813141315.GB457408@mwanda
1 parent 42f5fe3 commit 54f9ab7

File tree

1 file changed

+3
-0
lines changed
  • drivers/net/wireless/ath/ath6kl

1 file changed

+3
-0
lines changed

drivers/net/wireless/ath/ath6kl/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,9 @@ void ath6kl_connect_ap_mode_sta(struct ath6kl_vif *vif, u16 aid, u8 *mac_addr,
430430

431431
ath6kl_dbg(ATH6KL_DBG_TRC, "new station %pM aid=%d\n", mac_addr, aid);
432432

433+
if (aid < 1 || aid > AP_MAX_NUM_STA)
434+
return;
435+
433436
if (assoc_req_len > sizeof(struct ieee80211_hdr_3addr)) {
434437
struct ieee80211_mgmt *mgmt =
435438
(struct ieee80211_mgmt *) assoc_info;

0 commit comments

Comments
 (0)