Skip to content

Commit a87702e

Browse files
committed
Merge: CVE-2025-38116: wifi: ath12k: fix uaf in ath12k_core_init()
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7095 JIRA: https://issues.redhat.com/browse/RHEL-102086 CVE: CVE-2025-38116 ``` commit f3fe49d Author: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com> Date: Wed Jun 4 13:52:50 2025 +0800 wifi: ath12k: fix uaf in ath12k_core_init() When the execution of ath12k_core_hw_group_assign() or ath12k_core_hw_group_create() fails, the registered notifier chain is not unregistered properly. Its memory is freed after rmmod, which may trigger to a use-after-free (UAF) issue if there is a subsequent access to this notifier chain. Fixes the issue by calling ath12k_core_panic_notifier_unregister() in failure cases. Call trace: notifier_chain_register+0x4c/0x1f0 (P) atomic_notifier_chain_register+0x38/0x68 ath12k_core_init+0x50/0x4e8 [ath12k] ath12k_pci_probe+0x5f8/0xc28 [ath12k] pci_device_probe+0xbc/0x1a8 really_probe+0xc8/0x3a0 __driver_probe_device+0x84/0x1b0 driver_probe_device+0x44/0x130 __driver_attach+0xcc/0x208 bus_for_each_dev+0x84/0x100 driver_attach+0x2c/0x40 bus_add_driver+0x130/0x260 driver_register+0x70/0x138 __pci_register_driver+0x68/0x80 ath12k_pci_init+0x30/0x68 [ath12k] ath12k_init+0x28/0x78 [ath12k] Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Fixes: 6f245ea ("wifi: ath12k: introduce device group abstraction") Signed-off-by: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com> Reviewed-by: Baochen Qiang <quic_bqiang@quicinc.com> Link: https://patch.msgid.link/20250604055250.1228501-1-miaoqing.pan@oss.qualcomm.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com> ``` Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com> --- <small>Created 2025-07-07 11:52 UTC by backporter - [KWF FAQ](https://red.ht/kernel_workflow_doc) - [Slack #team-kernel-workflow](https://redhat-internal.slack.com/archives/C04LRUPMJQ5) - [Source](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/webhook/utils/backporter.py) - [Documentation](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/docs/README.backporter.md) - [Report an issue](https://issues.redhat.com/secure/CreateIssueDetails!init.jspa?pid=12334433&issuetype=1&priority=4&summary=backporter+webhook+issue&components=kernel-workflow+/+backporter)</small> Approved-by: Michal Schmidt <mschmidt@redhat.com> Approved-by: José Ignacio Tornos Martínez <jtornosm@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Augusto Caringi <acaringi@redhat.com>
2 parents cddbac2 + cac3419 commit a87702e

File tree

1 file changed

+7
-3
lines changed
  • drivers/net/wireless/ath/ath12k

1 file changed

+7
-3
lines changed

drivers/net/wireless/ath/ath12k/core.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,8 @@ int ath12k_core_init(struct ath12k_base *ab)
18911891
if (!ag) {
18921892
mutex_unlock(&ath12k_hw_group_mutex);
18931893
ath12k_warn(ab, "unable to get hw group\n");
1894-
return -ENODEV;
1894+
ret = -ENODEV;
1895+
goto err_unregister_notifier;
18951896
}
18961897

18971898
mutex_unlock(&ath12k_hw_group_mutex);
@@ -1906,17 +1907,20 @@ int ath12k_core_init(struct ath12k_base *ab)
19061907
if (ret) {
19071908
mutex_unlock(&ag->mutex);
19081909
ath12k_warn(ab, "unable to create hw group\n");
1909-
goto err;
1910+
goto err_destroy_hw_group;
19101911
}
19111912
}
19121913

19131914
mutex_unlock(&ag->mutex);
19141915

19151916
return 0;
19161917

1917-
err:
1918+
err_destroy_hw_group:
19181919
ath12k_core_hw_group_destroy(ab->ag);
19191920
ath12k_core_hw_group_unassign(ab);
1921+
err_unregister_notifier:
1922+
ath12k_core_panic_notifier_unregister(ab);
1923+
19201924
return ret;
19211925
}
19221926

0 commit comments

Comments
 (0)