HIGH
wifi libertas Timer UAF
CVE-2026-23281
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: wifi: libertas: fix use-after-free in lbs_free_adapter() The lbs_free_adapter() function uses timer_delete() (non-synchronous) for both command_timer and tx_lockup_timer before the structure is freed. This is incorrect because timer_delete() does not wait for any running timer callback to complete. If a timer callback is executing when lbs_free_adapter() is called, the callback will access freed memory since lbs_cfg_free() frees the containing structure immediately after lbs_free_adapter() returns. Both timer callbacks (lbs_cmd_timeout_handler and lbs_tx_lockup_handler) access priv->driver_lock, priv->cur_cmd, priv->dev, and other fields, which would all be use-after-free violations. Use timer_delete_sync() instead to ensure any running timer callback has completed before returning. This bug was introduced in commit 8f641d93c38a ("libertas: detect TX lockups and reset hardware") where del_timer() was used instead of del_timer_sync() in the cleanup path. The command_timer has had the same issue since the driver was first written.
02KernelScan AI Analysis
Risk summary
Local attackers with low privileges can trigger a use-after-free vulnerability in the libertas WiFi driver during device cleanup. This can lead to arbitrary code execution, privilege escalation, or system crashes when timer callbacks access freed memory structures.
Vulnerability analysis
The vulnerability occurs in lbs_free_adapter() where timer_delete() is used instead of timer_delete_sync() for command_timer and tx_lockup_timer cleanup. Since timer_delete() is non-synchronous, it doesn't wait for running timer callbacks to complete before returning. If timer callbacks (lbs_cmd_timeout_handler or lbs_tx_lockup_handler) are executing when the adapter structure is freed by lbs_cfg_free(), they will access freed memory including priv->driver_lock, priv->cur_cmd, and priv->dev fields. The fix replaces timer_delete() with timer_delete_sync() to ensure all timer callbacks complete before the structure is freed, preventing the race condition.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 5.10 | 5.10.253 | b15e0fa7adb4 |
| 5.15 | 5.15.203 | 09f3c30ab3b1 |
| 6.1 | 6.1.167 | 3f9dec4a6d95 |
| 6.12 | 6.12.78 | d0155fe68f31 |
| 6.18 | 6.18.17 | ed7d30f90b77 |
| 6.19 | 6.19.7 | a9f55b144864 |
| 6.6 | 6.6.130 | 3c5c818c78b0 |
| mainline | 7.0 | 03cc8f90d053 |