]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.10.214/wifi-ath10k-fix-null-pointer-dereference-in-ath10k_w.patch
Linux 5.10.214
[thirdparty/kernel/stable-queue.git] / releases / 5.10.214 / wifi-ath10k-fix-null-pointer-dereference-in-ath10k_w.patch
1 From ad6e3a384ed9e966aec5e3736af23bd01dafc26d Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Sun, 17 Dec 2023 13:29:01 +0200
4 Subject: wifi: ath10k: fix NULL pointer dereference in
5 ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev()
6
7 From: Xingyuan Mo <hdthky0@gmail.com>
8
9 [ Upstream commit ad25ee36f00172f7d53242dc77c69fff7ced0755 ]
10
11 We should check whether the WMI_TLV_TAG_STRUCT_MGMT_TX_COMPL_EVENT tlv is
12 present before accessing it, otherwise a null pointer deference error will
13 occur.
14
15 Fixes: dc405152bb64 ("ath10k: handle mgmt tx completion event")
16 Signed-off-by: Xingyuan Mo <hdthky0@gmail.com>
17 Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
18 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
19 Link: https://msgid.link/20231208043433.271449-1-hdthky0@gmail.com
20 Signed-off-by: Sasha Levin <sashal@kernel.org>
21 ---
22 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 4 ++++
23 1 file changed, 4 insertions(+)
24
25 diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
26 index 4f2fbc610d798..0eeb74245372f 100644
27 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
28 +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
29 @@ -844,6 +844,10 @@ ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev(struct ath10k *ar, struct sk_buff *skb,
30 }
31
32 ev = tb[WMI_TLV_TAG_STRUCT_MGMT_TX_COMPL_EVENT];
33 + if (!ev) {
34 + kfree(tb);
35 + return -EPROTO;
36 + }
37
38 arg->desc_id = ev->desc_id;
39 arg->status = ev->status;
40 --
41 2.43.0
42