{"id":"CVE-2022-49951","state":"PUBLISHED","title":"firmware_loader: Fix use-after-free during unregister","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nfirmware_loader: Fix use-after-free during unregister\n\nIn the following code within firmware_upload_unregister(), the call to\ndevice_unregister() could result in the dev_release function freeing the\nfw_upload_priv structure before it is dereferenced for the call to\nmodule_put(). This bug was found by the kernel test robot using\nCONFIG_KASAN while running the firmware selftests.\n\n  device_unregister(&fw_sysfs->dev);\n  module_put(fw_upload_priv->module);\n\nThe problem is fixed by copying fw_upload_priv->module to a local variable\nfor use when calling device_unregister().","publishedAt":"2025-06-18T11:00:14.694Z","updatedAt":"2026-05-11T19:09:49.839Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"97730bbb242cde22b7140acd202ffd88823886c9","status":"affected","lessThan":"d380d40930a674c520a5b55f3be1eb17dc634ebc","versionType":"git"},{"version":"97730bbb242cde22b7140acd202ffd88823886c9","status":"affected","lessThan":"8b40c38e37492b5bdf8e95b46b5cca9517a9957a","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/base/firmware_loader/sysfs_upload.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.19","versionType":"semver"},{"version":"5.19.8","status":"unaffected","lessThanOrEqual":"5.19.*","versionType":"semver"},{"version":"6.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/base/firmware_loader/sysfs_upload.c"]}],"references":["https://git.kernel.org/stable/c/d380d40930a674c520a5b55f3be1eb17dc634ebc","https://git.kernel.org/stable/c/8b40c38e37492b5bdf8e95b46b5cca9517a9957a"],"weaknesses":[],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/49xxx/CVE-2022-49951.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-49951","state":"PUBLISHED","datePublished":"2025-06-18T11:00:14.694Z","dateUpdated":"2026-05-11T19:09:49.839Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-06-18T10:57:27.382Z"},"containers":{"cna":{"title":"firmware_loader: Fix use-after-free during unregister","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nfirmware_loader: Fix use-after-free during unregister\n\nIn the following code within firmware_upload_unregister(), the call to\ndevice_unregister() could result in the dev_release function freeing the\nfw_upload_priv structure before it is dereferenced for the call to\nmodule_put(). This bug was found by the kernel test robot using\nCONFIG_KASAN while running the firmware selftests.\n\n  device_unregister(&fw_sysfs->dev);\n  module_put(fw_upload_priv->module);\n\nThe problem is fixed by copying fw_upload_priv->module to a local variable\nfor use when calling device_unregister()."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"97730bbb242cde22b7140acd202ffd88823886c9","status":"affected","lessThan":"d380d40930a674c520a5b55f3be1eb17dc634ebc","versionType":"git"},{"version":"97730bbb242cde22b7140acd202ffd88823886c9","status":"affected","lessThan":"8b40c38e37492b5bdf8e95b46b5cca9517a9957a","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/base/firmware_loader/sysfs_upload.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.19","versionType":"semver"},{"version":"5.19.8","status":"unaffected","lessThanOrEqual":"5.19.*","versionType":"semver"},{"version":"6.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/base/firmware_loader/sysfs_upload.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/d380d40930a674c520a5b55f3be1eb17dc634ebc"},{"url":"https://git.kernel.org/stable/c/8b40c38e37492b5bdf8e95b46b5cca9517a9957a"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T19:09:49.839Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"5.19.8"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.0"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}