* [PATCH] wifi: ath12k: fix leaking michael_mic for non-primary links
@ 2024-12-06 5:45 Baochen Qiang
2024-12-06 20:48 ` Jeff Johnson
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Baochen Qiang @ 2024-12-06 5:45 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, quic_bqiang
In ath12k_dp_rx_peer_frag_setup(), commit ea4192553850 ("wifi: ath12k: add primary
link for data path operations") checks whether a link is the primary link, and
returns directly if it isn't. In ML scenario where we have non-primary links created,
this results in leaking the michael_mic info since it is allocated by default but
could never be freed for a non-primary link.
Note that we can not move the might-sleep allocation after primary link check since
there we are in atomic context (due to spin lock). So keep the default allocation,
and then free it before return to fix this issue.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
Fixes: ea4192553850 ("wifi: ath12k: add primary link for data path operations")
Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
---
drivers/net/wireless/ath/ath12k/dp_rx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c
index b24d1de4aabb..f8e79eff2089 100644
--- a/drivers/net/wireless/ath/ath12k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_rx.c
@@ -2830,6 +2830,7 @@ int ath12k_dp_rx_peer_frag_setup(struct ath12k *ar, const u8 *peer_mac, int vdev
if (!peer->primary_link) {
spin_unlock_bh(&ab->base_lock);
+ crypto_free_shash(tfm);
return 0;
}
base-commit: 3b2ab397d31f926523f2781d7f0a14a387415bf4
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] wifi: ath12k: fix leaking michael_mic for non-primary links
2024-12-06 5:45 [PATCH] wifi: ath12k: fix leaking michael_mic for non-primary links Baochen Qiang
@ 2024-12-06 20:48 ` Jeff Johnson
2024-12-09 15:37 ` Kalle Valo
2024-12-11 17:20 ` Jeff Johnson
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Johnson @ 2024-12-06 20:48 UTC (permalink / raw)
To: Baochen Qiang, ath12k; +Cc: linux-wireless
On 12/5/2024 9:45 PM, Baochen Qiang wrote:
> In ath12k_dp_rx_peer_frag_setup(), commit ea4192553850 ("wifi: ath12k: add primary
> link for data path operations") checks whether a link is the primary link, and
> returns directly if it isn't. In ML scenario where we have non-primary links created,
> this results in leaking the michael_mic info since it is allocated by default but
> could never be freed for a non-primary link.
>
> Note that we can not move the might-sleep allocation after primary link check since
> there we are in atomic context (due to spin lock). So keep the default allocation,
> and then free it before return to fix this issue.
>
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
>
> Fixes: ea4192553850 ("wifi: ath12k: add primary link for data path operations")
> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Acked-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] wifi: ath12k: fix leaking michael_mic for non-primary links
2024-12-06 5:45 [PATCH] wifi: ath12k: fix leaking michael_mic for non-primary links Baochen Qiang
2024-12-06 20:48 ` Jeff Johnson
@ 2024-12-09 15:37 ` Kalle Valo
2024-12-11 17:20 ` Jeff Johnson
2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2024-12-09 15:37 UTC (permalink / raw)
To: Baochen Qiang; +Cc: ath12k, linux-wireless
Baochen Qiang <quic_bqiang@quicinc.com> writes:
> In ath12k_dp_rx_peer_frag_setup(), commit ea4192553850 ("wifi: ath12k: add primary
> link for data path operations") checks whether a link is the primary link, and
> returns directly if it isn't. In ML scenario where we have non-primary links created,
> this results in leaking the michael_mic info since it is allocated by default but
> could never be freed for a non-primary link.
>
> Note that we can not move the might-sleep allocation after primary link check since
> there we are in atomic context (due to spin lock). So keep the default allocation,
> and then free it before return to fix this issue.
>
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
>
> Fixes: ea4192553850 ("wifi: ath12k: add primary link for data path operations")
> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Acked-by: Kalle Valo <kvalo@kernel.org>
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] wifi: ath12k: fix leaking michael_mic for non-primary links
2024-12-06 5:45 [PATCH] wifi: ath12k: fix leaking michael_mic for non-primary links Baochen Qiang
2024-12-06 20:48 ` Jeff Johnson
2024-12-09 15:37 ` Kalle Valo
@ 2024-12-11 17:20 ` Jeff Johnson
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Johnson @ 2024-12-11 17:20 UTC (permalink / raw)
To: ath12k, Baochen Qiang; +Cc: linux-wireless
On Fri, 06 Dec 2024 13:45:52 +0800, Baochen Qiang wrote:
> In ath12k_dp_rx_peer_frag_setup(), commit ea4192553850 ("wifi: ath12k: add primary
> link for data path operations") checks whether a link is the primary link, and
> returns directly if it isn't. In ML scenario where we have non-primary links created,
> this results in leaking the michael_mic info since it is allocated by default but
> could never be freed for a non-primary link.
>
> Note that we can not move the might-sleep allocation after primary link check since
> there we are in atomic context (due to spin lock). So keep the default allocation,
> and then free it before return to fix this issue.
>
> [...]
Applied, thanks!
[1/1] wifi: ath12k: fix leaking michael_mic for non-primary links
commit: 02f41c8aa643b0d329ee9fa3f3341919bf86b759
Best regards,
--
Jeff Johnson <jeff.johnson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-12-11 17:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-06 5:45 [PATCH] wifi: ath12k: fix leaking michael_mic for non-primary links Baochen Qiang
2024-12-06 20:48 ` Jeff Johnson
2024-12-09 15:37 ` Kalle Valo
2024-12-11 17:20 ` Jeff Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).