# CVE-2022-49951: firmware_loader: Fix use-after-free during unregister

- Severity: High 7.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.26%, higher than 18% of CVEs (2026-12-01)
- Published: 2025-06-18T11:00:14.694Z
- Modified: 2026-06-17T05:19:36.473Z
- Weaknesses: CWE-416
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

firmware_loader: Fix use-after-free during unregister

In the following code within firmware_upload_unregister(), the call to
device_unregister() could result in the dev_release function freeing the
fw_upload_priv structure before it is dereferenced for the call to
module_put(). This bug was found by the kernel test robot using
CONFIG_KASAN while running the firmware selftests.

  device_unregister(&fw_sysfs->dev);
  module_put(fw_upload_priv->module);

The problem is fixed by copying fw_upload_priv->module to a local variable
for use when calling device_unregister().

(As written by CVE List.)

## Affected

- Linux Linux: from 97730bbb242cde22b7140acd202ffd88823886c9 before d380d40930a674c520a5b55f3be1eb17dc634ebc; from 97730bbb242cde22b7140acd202ffd88823886c9 before 8b40c38e37492b5bdf8e95b46b5cca9517a9957a; 5.19 (not affected: before 5.19; from 5.19.8 up to 5.19.*; from 6.0 up to *)
- linux linux_kernel: from 5.19 before 5.19.8; 6.0

## References

- <https://git.kernel.org/stable/c/d380d40930a674c520a5b55f3be1eb17dc634ebc> (patch)
- <https://git.kernel.org/stable/c/8b40c38e37492b5bdf8e95b46b5cca9517a9957a> (patch)

## Sources

- CVE List: [CVE-2022-49951](https://www.cve.org/CVERecord?id=CVE-2022-49951), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2022-49951](https://nvd.nist.gov/vuln/detail/CVE-2022-49951), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-49951 · Whole record: https://cve.day/CVE-2022-49951.json · Rebuilt by cve.day 2026-11-25T22:58:20.978Z
