mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 00:25:24 -04:00
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: 572e27c00c ("ath6kl: Fix AP mode connect event parsing and TIM updates")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200813141315.GB457408@mwanda
This commit is contained in:
committed by
Kalle Valo
parent
42f5fe34a7
commit
54f9ab7b87
@@ -430,6 +430,9 @@ void ath6kl_connect_ap_mode_sta(struct ath6kl_vif *vif, u16 aid, u8 *mac_addr,
|
||||
|
||||
ath6kl_dbg(ATH6KL_DBG_TRC, "new station %pM aid=%d\n", mac_addr, aid);
|
||||
|
||||
if (aid < 1 || aid > AP_MAX_NUM_STA)
|
||||
return;
|
||||
|
||||
if (assoc_req_len > sizeof(struct ieee80211_hdr_3addr)) {
|
||||
struct ieee80211_mgmt *mgmt =
|
||||
(struct ieee80211_mgmt *) assoc_info;
|
||||
|
||||
Reference in New Issue
Block a user