wifi: ath10k: fix NULL pointer dereference in ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev()
PATCH v2 1/1 wifi: ath10k: fix NULL pointer dereference in ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev()
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.
---
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(+)
drivers/net/wireless/ath/ath10k/wmi-tlv.c +4 -0
@@ -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;
Signature · 1 line
2.34.1
Quoted 6 lines · Xingyuan Mo
We should check whether the
WMI_TLV_TAG_STRUCT_MGMT_TX_COMPL_EVENTtlv 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 <[email protected]>
Quoted 8 lines · Xingyuan Mo
We should check whether the
WMI_TLV_TAG_STRUCT_MGMT_TX_COMPL_EVENTtlv 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 <[email protected]>Acked-by Jeff Johnson <[email protected]>Signed-off-by Kalle Valo <[email protected]>
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()
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches