{"id":"CVE-2022-49385","state":"PUBLISHED","title":"driver: base: fix UAF when driver_attach failed","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ndriver: base: fix UAF when driver_attach failed\n\nWhen driver_attach(drv); failed, the driver_private will be freed.\nBut it has been added to the bus, which caused a UAF.\n\nTo fix it, we need to delete it from the bus when failed.","publishedAt":"2025-02-26T02:11:20.725Z","updatedAt":"2026-08-05T08:54:58.796Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"190888ac01d059e38ffe77a2291d44cafa9016fb","status":"affected","lessThan":"5d709f58c743166fe1c6914b9de0ae8868600d9b","versionType":"git"},{"version":"190888ac01d059e38ffe77a2291d44cafa9016fb","status":"affected","lessThan":"823f24f2e329babd0330200d0b74882516fe57f4","versionType":"git"},{"version":"190888ac01d059e38ffe77a2291d44cafa9016fb","status":"affected","lessThan":"cdf1a683a01583bca4b618dd16223cbd6e462e21","versionType":"git"},{"version":"190888ac01d059e38ffe77a2291d44cafa9016fb","status":"affected","lessThan":"5389101257828d1913d713d9a40acbe14f5961df","versionType":"git"},{"version":"190888ac01d059e38ffe77a2291d44cafa9016fb","status":"affected","lessThan":"c059665c84feab46b7173d3a1bf36c2fb7f9df86","versionType":"git"},{"version":"190888ac01d059e38ffe77a2291d44cafa9016fb","status":"affected","lessThan":"310862e574001a97ad02272bac0fd13f75f42a27","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/base/bus.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.9","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.9","versionType":"semver"},{"version":"5.4.198","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.122","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.47","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"5.17.15","status":"unaffected","lessThanOrEqual":"5.17.*","versionType":"semver"},{"version":"5.18.4","status":"unaffected","lessThanOrEqual":"5.18.*","versionType":"semver"},{"version":"5.19","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/base/bus.c"]}],"references":["https://git.kernel.org/stable/c/5d709f58c743166fe1c6914b9de0ae8868600d9b","https://git.kernel.org/stable/c/823f24f2e329babd0330200d0b74882516fe57f4","https://git.kernel.org/stable/c/cdf1a683a01583bca4b618dd16223cbd6e462e21","https://git.kernel.org/stable/c/5389101257828d1913d713d9a40acbe14f5961df","https://git.kernel.org/stable/c/c059665c84feab46b7173d3a1bf36c2fb7f9df86","https://git.kernel.org/stable/c/310862e574001a97ad02272bac0fd13f75f42a27"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/49xxx/CVE-2022-49385.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-49385","state":"PUBLISHED","datePublished":"2025-02-26T02:11:20.725Z","dateUpdated":"2026-08-05T08:54:58.796Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-02-26T02:08:31.560Z"},"containers":{"cna":{"title":"driver: base: fix UAF when driver_attach failed","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ndriver: base: fix UAF when driver_attach failed\n\nWhen driver_attach(drv); failed, the driver_private will be freed.\nBut it has been added to the bus, which caused a UAF.\n\nTo fix it, we need to delete it from the bus when failed."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"190888ac01d059e38ffe77a2291d44cafa9016fb","status":"affected","lessThan":"5d709f58c743166fe1c6914b9de0ae8868600d9b","versionType":"git"},{"version":"190888ac01d059e38ffe77a2291d44cafa9016fb","status":"affected","lessThan":"823f24f2e329babd0330200d0b74882516fe57f4","versionType":"git"},{"version":"190888ac01d059e38ffe77a2291d44cafa9016fb","status":"affected","lessThan":"cdf1a683a01583bca4b618dd16223cbd6e462e21","versionType":"git"},{"version":"190888ac01d059e38ffe77a2291d44cafa9016fb","status":"affected","lessThan":"5389101257828d1913d713d9a40acbe14f5961df","versionType":"git"},{"version":"190888ac01d059e38ffe77a2291d44cafa9016fb","status":"affected","lessThan":"c059665c84feab46b7173d3a1bf36c2fb7f9df86","versionType":"git"},{"version":"190888ac01d059e38ffe77a2291d44cafa9016fb","status":"affected","lessThan":"310862e574001a97ad02272bac0fd13f75f42a27","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/base/bus.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.9","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.9","versionType":"semver"},{"version":"5.4.198","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.122","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.47","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"5.17.15","status":"unaffected","lessThanOrEqual":"5.17.*","versionType":"semver"},{"version":"5.18.4","status":"unaffected","lessThanOrEqual":"5.18.*","versionType":"semver"},{"version":"5.19","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/base/bus.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/5d709f58c743166fe1c6914b9de0ae8868600d9b"},{"url":"https://git.kernel.org/stable/c/823f24f2e329babd0330200d0b74882516fe57f4"},{"url":"https://git.kernel.org/stable/c/cdf1a683a01583bca4b618dd16223cbd6e462e21"},{"url":"https://git.kernel.org/stable/c/5389101257828d1913d713d9a40acbe14f5961df"},{"url":"https://git.kernel.org/stable/c/c059665c84feab46b7173d3a1bf36c2fb7f9df86"},{"url":"https://git.kernel.org/stable/c/310862e574001a97ad02272bac0fd13f75f42a27"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerable path is bus_add_driver() in the local driver core, reached via driver_register() during module load/autoload or privileged driver bind—not via network packet processing or adjacent-link protocols.\nAC:L - Once driver_attach() returns an error, kobject_put frees driver_private while knode_bus remains linked on klist_drivers with no get/put callbacks, leaving a permanent dangling list node; subsequent bus_for_each_drv()/device_attach iteration hits the UAF deterministically with no race the attacker must win.\nPR:L - Although direct init_module requires CAP_SYS_MODULE, unprivileged local users can trigger module autoload (request_module via sockets, filesystems, etc.) so that modprobe runs driver_register() in kernel context, and after the dangling entry is planted any local user can exercise bus driver iteration; when uncertain, Low is required over High.\nUI:N - The attacker triggers driver registration and later bus_for_each_drv use themselves through local operations; no separate victim action such as mounting a filesystem or opening a crafted file is required.\nS:U - Impact is use-after-free of kernel driver_private within the host kernel’s driver-core lists, enabling standard local privilege escalation in the same security authority without VM escape or IOMMU/sandbox boundary crossing.\nC:H - Use-after-free of the kmalloc’d driver_private (containing kobject and driver pointer) allows heap reuse and arbitrary kernel memory disclosure when next_driver()/bus_for_each_drv walks the dangling knode, scored Confidentiality High per UAF guidance.\nI:H - The same UAF on a list-linked slab object enables heap spraying and corruption of adjacent kernel objects or control-flow hijack when driver matching/probe paths dereference the reclaimed driver_private, scored Integrity High.\nA:H - Walking a freed klist_node or dereferencing drv_priv->driver after free can oops/panic the kernel even without full exploitation, so Availability impact is High."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T08:54:58.796Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.9","versionEndExcluding":"5.4.198"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.9","versionEndExcluding":"5.10.122"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.9","versionEndExcluding":"5.15.47"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.9","versionEndExcluding":"5.17.15"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.9","versionEndExcluding":"5.18.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.9","versionEndExcluding":"5.19"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2022-49385","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2025-02-27T17:58:41.954887Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-416","lang":"en","type":"CWE","description":"CWE-416 Use After Free"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-02-27T18:02:28.951Z"}}]}}}