ATH10K Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] wifi: ath10k: fix NULL pointer dereference in ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev()
@ 2023-12-08  4:34 Xingyuan Mo
  2023-12-11 17:37 ` Jeff Johnson
  2023-12-18 18:41 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Xingyuan Mo @ 2023-12-08  4:34 UTC (permalink / raw)
  To: Kalle Valo, Jeff Johnson,
	open list:QUALCOMM ATHEROS ATH10K WIRELESS DRIVER
  Cc: open list:NETWORKING DRIVERS (WIRELESS), Xingyuan Mo

We should check whether the WMI_TLV_TAG_STRUCT_MGMT_TX_COMPL_EVENT tlv is
present before accessing it, otherwise a null pointer deference error will
occur.

Fixes: dc405152bb64 ("ath10k: handle mgmt tx completion event")
Signed-off-by: Xingyuan Mo <hdthky0@gmail.com>
---
Compared with the previous version, Signed-off-by and Fixes tags are added.

 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 6b6aa3c36744..0ce08e9a0a3d 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -851,6 +851,10 @@ ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev(struct ath10k *ar, struct sk_buff *skb,
 	}
 
 	ev = tb[WMI_TLV_TAG_STRUCT_MGMT_TX_COMPL_EVENT];
+	if (!ev) {
+		kfree(tb);
+		return -EPROTO;
+	}
 
 	arg->desc_id = ev->desc_id;
 	arg->status = ev->status;
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] wifi: ath10k: fix NULL pointer dereference in ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev()
  2023-12-08  4:34 [PATCH v2] wifi: ath10k: fix NULL pointer dereference in ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev() Xingyuan Mo
@ 2023-12-11 17:37 ` Jeff Johnson
  2023-12-18 18:41 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Johnson @ 2023-12-11 17:37 UTC (permalink / raw)
  To: Xingyuan Mo, Kalle Valo,
	open list:QUALCOMM ATHEROS ATH10K WIRELESS DRIVER
  Cc: open list:NETWORKING DRIVERS (WIRELESS)

On 12/7/2023 8:34 PM, Xingyuan Mo wrote:
> We should check whether the WMI_TLV_TAG_STRUCT_MGMT_TX_COMPL_EVENT tlv is
> present before accessing it, otherwise a null pointer deference error will
> occur.
> 
> Fixes: dc405152bb64 ("ath10k: handle mgmt tx completion event")
> Signed-off-by: Xingyuan Mo <hdthky0@gmail.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] wifi: ath10k: fix NULL pointer dereference in ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev()
  2023-12-08  4:34 [PATCH v2] wifi: ath10k: fix NULL pointer dereference in ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev() Xingyuan Mo
  2023-12-11 17:37 ` Jeff Johnson
@ 2023-12-18 18:41 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2023-12-18 18:41 UTC (permalink / raw)
  To: Xingyuan Mo
  Cc: Jeff Johnson, open list:QUALCOMM ATHEROS ATH10K WIRELESS DRIVER,
	open list:NETWORKING DRIVERS (WIRELESS), Xingyuan Mo

Xingyuan Mo <hdthky0@gmail.com> wrote:

> We should check whether the WMI_TLV_TAG_STRUCT_MGMT_TX_COMPL_EVENT tlv is
> present before accessing it, otherwise a null pointer deference error will
> occur.
> 
> Fixes: dc405152bb64 ("ath10k: handle mgmt tx completion event")
> Signed-off-by: Xingyuan Mo <hdthky0@gmail.com>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

ad25ee36f001 wifi: ath10k: fix NULL pointer dereference in ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20231208043433.271449-1-hdthky0@gmail.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-18 18:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-08  4:34 [PATCH v2] wifi: ath10k: fix NULL pointer dereference in ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev() Xingyuan Mo
2023-12-11 17:37 ` Jeff Johnson
2023-12-18 18:41 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox