wifi: brcmfmac: fix use-after-free when rescheduling brcmf_btcoex_info work
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 61730d4dfffc2cc9d3a49fad87633008105c18ba · < 9cb83d4be0b9b697eae93d321e0da999f9cdfcfc| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
wifi: brcmfmac: fix use-after-free when rescheduling brcmf_btcoex_info work
The brcmf_btcoex_detach() only shuts down the btcoex timer, if the flag timer_on is false. However, the brcmf_btcoex_timerfunc(), which runs as timer handler, sets timer_on to false. This creates critical race conditions:
1.If brcmf_btcoex_detach() is called while brcmf_btcoex_timerfunc() is executing, it may observe timer_on as false and skip the call to timer_shutdown_sync().
2.The brcmf_btcoex_timerfunc() may then reschedule the brcmf_btcoex_info worker after the cancel_work_sync() has been executed, resulting in use-after-free bugs.
The use-after-free bugs occur in two distinct scenarios, depending on the timing of when the brcmf_btcoex_info struct is freed relative to the execution of its worker thread.
Scenario 1: Freed before the worker is scheduled
The brcmf_btcoex_info is deallocated before the worker is scheduled. A race condition can occur when schedule_work(&bt_local->work) is called after the target memory has been freed. The sequence of events is detailed below:
From the CVE record · Linux
A race between Bluetooth coexistence timer handling and detachment in the Linux kernel's brcmfmac Wi-Fi driver can reschedule work after its data is freed, causing a use-after-free. The input does not specify how an attacker could trigger the race or whether network access, authentication, or user interaction is required.
Engineers running Linux kernels with the brcmfmac Wi-Fi driver should check their kernel versions; affected versions are not specified.