wifi: ath11k: fix suspend use-after-free after probe failure
PATCH 1/1 wifi: ath11k: fix suspend use-after-free after probe failure
Make sure to deregister the PM notifier to avoid a use-after-free on suspend in case core initialisation fails (e.g. due to missing firmware).
--- drivers/net/wireless/ath/ath11k/core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/core.c +6 -1
@@ -2581,10 +2581,15 @@ int ath11k_core_init(struct ath11k_base *ab) ret =ath11k_core_soc_create (ab);if (ret) {ath11k_err (ab,"failed to create soc core: %d\n" , ret); -return ret; + goto err_unregister_pm_notifier; }return 0 ; + +err_unregister_pm_notifier: +ath11k_core_pm_notifier_unregister (ab); + +return ret; }EXPORT_SYMBOL (ath11k_core_init);
Signature · 1 line
2.49.0
Quoted 3 lines · Johan Hovold
Make sure to deregister the PM notifier to avoid a use-after-free on suspend in case core initialisation fails (e.g. due to missing firmware).
Not sure it matters in this case, but forgot to include:
Tested-on: WCN6855 hw2.0 WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.41
Quoted 5 lines
Fixes 32d93b51bc7e ("wifi: ath11k: choose default PM policy for hibernation")Reported-by Konrad Dybcio <[email protected]>Cc Baochen Qiang <[email protected]>Signed-off-by Johan Hovold <[email protected]>
Johan
Quoted 8 lines · Johan Hovold
Quoted 3 lines · Johan Hovold
Make sure to deregister the PM notifier to avoid a use-after-free on suspend in case core initialisation fails (e.g. due to missing firmware).
Not sure it matters in this case, but forgot to include:
Tested-on: WCN6855 hw2.0 WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.41
I'll add that.
I'll also change the Link: to Closes: per checkpatch:
WARNING:BAD_REPORTED_BY_LINK: Reported-by: should be immediately followed by Closes: with a URL to the report
Quoted 8 lines
Quoted 6 lines
Fixes 32d93b51bc7e ("wifi: ath11k: choose default PM policy for hibernation")Reported-by Konrad Dybcio <[email protected]>Cc Baochen Qiang <[email protected]>Signed-off-by Johan Hovold <[email protected]>Johan
Quoted 6 lines · Jeff Johnson
Quoted 5 lines · Johan Hovold
Quoted 3 lines · Johan Hovold
Make sure to deregister the PM notifier to avoid a use-after-free on suspend in case core initialisation fails (e.g. due to missing firmware).
Quoted 8 lines
Quoted 3 lines
Not sure it matters in this case, but forgot to include:
Tested-on: WCN6855 hw2.0 WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.41
I'll add that.
I'll also change the Link: to Closes: per checkpatch:WARNING:BAD_REPORTED_BY_LINK: Reported-by: should be immediately followed by Closes: with a URL to the report
Please check pending patch:
https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git/commit/?h=pending&id=2418079880408c5ae0b2a93f72af044eaff18cb6
Quoted 7 lines · Jeff Johnson
Quoted 6 lines · Jeff Johnson
Quoted 5 lines · Johan Hovold
Quoted 3 lines · Johan Hovold
Make sure to deregister the PM notifier to avoid a use-after-free on suspend in case core initialisation fails (e.g. due to missing firmware).
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Not sure it matters in this case, but forgot to include:
Tested-on: WCN6855 hw2.0 WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.41
I'll add that.
I'll also change the Link: to Closes: per checkpatch:WARNING:BAD_REPORTED_BY_LINK: Reported-by: should be immediately followed by Closes: with a URL to the report
Checkpatch is just a tool and it's output should not be treated as something that you must follow.
Linus reluctantly allowed Closes: to be used as an *alternative* to
Link: [1], but then there was mission creep and now checkpatch has started warning about a perfectly valid Link: tag after Reported-by:
without that even being made clear in the commit message [2].
I'll stick with Link: (like Linus still do most of the time), but I don't mind if you want to change this to Closes: for ath11k.
Quoted 2 lines
Please check pending patch:
https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git/commit/?h=pending&id=2418079880408c5ae0b2a93f72af044eaff18cb6
Looks good, thanks.
Johan
[1] https://lore.kernel.org/lkml/CAHk-=wh0v1EeDV3v8TzK81nDC40=XuTdY2MCr0xy3m3FiBV3+Q@mail.gmail.com/
[2] https://lore.kernel.org/lkml/20230314-doc-checkpatch-closes-tag-v4-4-d26d1fa66f9f@tessares.net/
Jeff Johnson
AppliedQuoted 5 lines · Johan Hovold
Make sure to deregister the PM notifier to avoid a use-after-free on suspend in case core initialisation fails (e.g. due to missing firmware).
Applied, thanks!
[1/1] wifi: ath11k: fix suspend use-after-free after probe failure
commit: 8f9480451514c065dc8296c0db6e26d6c467fafe
Best regards,
Signature · 1 line
Jeff Johnson <[email protected]>