firmware_loader: do not queue completed sysfs fallback requests
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 75d95e2e39b27f733f21e6668af1c9893a97de5e · < 6eaa632d0ed7bbb84f9cb670e5ec4e2cecf4cc7b| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
firmware_loader: do not queue completed sysfs fallback requests
fw_load_sysfs_fallback() calls device_add() before adding the fw_priv to pending_fw_head. device_add() publishes the fallback loading interface, so a userspace helper which discovers the device by scanning sysfs can write 0 to the loading attribute and complete the request before it is queued as pending.
In that interleaving firmware_loading_store() calls fw_state_done() while pending_list still points to itself, so it cannot remove an entry from pending_fw_head. The subsequent unconditional list_add() then queues an already-completed fw_priv. Once the request is released, pending_fw_head can retain a pointer to freed memory and the next fallback request can fault while validating the list.
Only in-flight fallback requests need suspend or reboot abort handling. If the request is already DONE after device_add(), return success from the fallback path without sending another uevent, waiting again, or queueing it as pending. This preserves the invariant that pending_fw_head contains only active fallback requests.
From the CVE record · Linux
The Linux kernel firmware loader can queue an already-completed sysfs fallback request, leaving a pointer to freed memory. A local userspace helper can trigger this race by completing a request through sysfs before it is queued; a later fallback request can then fault. The input does not specify authentication requirements beyond access to the sysfs loading interface.
Engineers running Linux kernels that use firmware loader sysfs fallback should check their affected versions; none are specified in the input.