CVE-2024-56599
Severity CVSS v4.0:
Pending analysis
Type:
CWE-476
NULL Pointer Dereference
Publication date:
27/12/2024
Last modified:
03/11/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
wifi: ath10k: avoid NULL pointer error during sdio remove<br />
<br />
When running &#39;rmmod ath10k&#39;, ath10k_sdio_remove() will free sdio<br />
workqueue by destroy_workqueue(). But if CONFIG_INIT_ON_FREE_DEFAULT_ON<br />
is set to yes, kernel panic will happen:<br />
Call trace:<br />
destroy_workqueue+0x1c/0x258<br />
ath10k_sdio_remove+0x84/0x94<br />
sdio_bus_remove+0x50/0x16c<br />
device_release_driver_internal+0x188/0x25c<br />
device_driver_detach+0x20/0x2c<br />
<br />
This is because during &#39;rmmod ath10k&#39;, ath10k_sdio_remove() will call<br />
ath10k_core_destroy() before destroy_workqueue(). wiphy_dev_release()<br />
will finally be called in ath10k_core_destroy(). This function will free<br />
struct cfg80211_registered_device *rdev and all its members, including<br />
wiphy, dev and the pointer of sdio workqueue. Then the pointer of sdio<br />
workqueue will be set to NULL due to CONFIG_INIT_ON_FREE_DEFAULT_ON.<br />
<br />
After device release, destroy_workqueue() will use NULL pointer then the<br />
kernel panic happen.<br />
<br />
Call trace:<br />
ath10k_sdio_remove<br />
->ath10k_core_unregister<br />
……<br />
->ath10k_core_stop<br />
->ath10k_hif_stop<br />
->ath10k_sdio_irq_disable<br />
->ath10k_hif_power_down<br />
->del_timer_sync(&ar_sdio->sleep_timer)<br />
->ath10k_core_destroy<br />
->ath10k_mac_destroy<br />
->ieee80211_free_hw<br />
->wiphy_free<br />
……<br />
->wiphy_dev_release<br />
->destroy_workqueue<br />
<br />
Need to call destroy_workqueue() before ath10k_core_destroy(), free<br />
the work queue buffer first and then free pointer of work queue by<br />
ath10k_core_destroy(). This order matches the error path order in<br />
ath10k_sdio_probe().<br />
<br />
No work will be queued on sdio workqueue between it is destroyed and<br />
ath10k_core_destroy() is called. Based on the call_stack above, the<br />
reason is:<br />
Only ath10k_sdio_sleep_timer_handler(), ath10k_sdio_hif_tx_sg() and<br />
ath10k_sdio_irq_disable() will queue work on sdio workqueue.<br />
Sleep timer will be deleted before ath10k_core_destroy() in<br />
ath10k_hif_power_down().<br />
ath10k_sdio_irq_disable() only be called in ath10k_hif_stop().<br />
ath10k_core_unregister() will call ath10k_hif_power_down() to stop hif<br />
bus, so ath10k_sdio_hif_tx_sg() won&#39;t be called anymore.<br />
<br />
Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00189
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.12.5 (excluding) |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/27d5d217ae7ffb99dd623375a17a7d3418d9c755
- https://git.kernel.org/stable/c/27fda36eedad9e4ec795dc481f307901d1885112
- https://git.kernel.org/stable/c/543c0924d446b21f35701ca084d7feca09511220
- https://git.kernel.org/stable/c/6e5dbd1c04abf2c19b2282915e6fa48b6ccc6921
- https://git.kernel.org/stable/c/95c38953cb1ecf40399a676a1f85dfe2b5780a9a
- https://git.kernel.org/stable/c/b35de9e01fc79c7baac666fb2dcb4ba7698a1d97
- https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html
- https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html



