wifi: libertas_tf: fix use-after-free in lbtf_free_adapter()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 06b16ae5319251c26377afcb401e46056d5673f4 · < fcff712d0e3d183843ec3916470ee6cc3455baad| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
wifi: libertas_tf: fix use-after-free in lbtf_free_adapter()
lbtf_free_adapter() calls timer_delete(&priv->command_timer), which does not wait for a running command_timer_fn() callback. lbtf_free_adapter() runs on the teardown path right before ieee80211_free_hw() frees priv, both in lbtf_remove_card() and in the probe error path. command_timer is armed by mod_timer() in lbtf_cmd() whenever a firmware command is sent. command_timer_fn() dereferences priv. If a command times out as the device is removed, command_timer_fn() runs concurrently with teardown and dereferences priv after it has been freed.
This is the same use-after-free that commit 03cc8f90d053 ("wifi: libertas: fix use-after-free in lbs_free_adapter()") fixed in the sibling libertas driver. The libertas_tf variant has the identical pattern and was left unchanged. Use timer_delete_sync() so any in-flight callback completes before priv is freed.
From the CVE record · Linux
The Linux kernel’s libertas_tf Wi-Fi driver can use freed memory during device teardown. If a firmware command times out as the device is removed, a timer callback can access the adapter after it has been freed. The input does not identify an attacker route or authentication requirements.
Engineers running Linux kernels with the libertas_tf Wi-Fi driver should check their deployments; affected versions are not specified.