wifi: rt2x00: avoid full teardown before work setup in probe
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 0439f5367c8d8bb2ebaca8d7329f51f3148b2fb2 · < 816559409e340acaa5c9d868291dab30d8c80263| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
wifi: rt2x00: avoid full teardown before work setup in probe
rt2x00lib_probe_dev() uses the full rt2x00lib_remove_dev() teardown for all probe failures. However, drv_data allocation and workqueue allocation can fail before intf_work, autowakeup_work and sleep_work have been initialized.
Do not enter the full remove path until the probe has reached the point where those work items are set up. Return directly for drv_data allocation failure, and use a small early cleanup path for workqueue allocation failure.
This issue was found by our static analysis tool and then confirmed by manual review of rt2x00lib_probe_dev() and rt2x00lib_remove_dev(). The early probe exits should not call a common teardown path that assumes the later work setup has already completed.
A QEMU PoC forced alloc_ordered_workqueue() to fail before the work initializers are reached. The resulting fail path entered rt2x00lib_remove_dev(), and DEBUG_OBJECTS reported invalid work drains with rt2x00lib_probe_dev() and rt2x00lib_remove_dev() in the stack.
From the CVE record · Linux
The Linux kernel’s rt2x00 Wi-Fi driver can enter its full teardown path if an allocation fails during device probing, before work items have been initialized. This can cause invalid work drains. The input does not establish an attacker trigger or specify network access, authentication, or user interaction requirements.
Engineers running Linux kernels with the rt2x00 Wi-Fi driver should check their kernel versions; affected versions are not specified.