{"id":"CVE-2026-142792","summary":"resource: report a devm_request_resource() conflict under the lock","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nresource: report a devm_request_resource() conflict under the lock\n\ndevm_request_resource() calls request_resource_conflict(), which takes\nresource_lock, tries to insert the new resource and returns a pointer to\nthe conflicting resource after dropping the lock.  The error message is\nthen formatted from that pointer: conflict-\u003ename and the %pR argument\nread the name, start, end, flags and desc of a resource that nothing\npins any more.  The owner of the conflicting resource may call\nrelease_resource() and free it the moment the lock is dropped.\n\nThe conflicting resource normally belongs to another device.  With two\ndevices whose drivers claim overlapping regions (two PCI host bridges\nwhose \"ranges\" windows overlap, two instances of a controller on the\nsame aperture, or a stale claim an administrator is replacing), the\nfollowing interleaving reads freed memory:\n\n  CPU 0: driver B probe                  CPU 1: driver A unbind\n  devm_request_resource(devB, root, resB)\n    request_resource_conflict()\n      write_lock(&resource_lock)\n      __request_resource() -\u003e resA\n      write_unlock(&resource_lock)\n                                         devres_release_all(devA)\n                                           devm_resource_release()\n                                             release_resource(resA)\n                                         put_device() -\u003e kfree(resA)\n    dev_err(..., resA-\u003ename, resA)        use after free\n\nBoth halves are reachable from userspace on any kernel: a write to the\n\"unbind\" file of the driver that holds the region and a write to the\n\"bind\" file of the driver that wants it.  One in-tree path is\ndrivers/pci/bus.c devm_request_pci_bus_resources(), called from host\nbridge probe for every bridge window; the windows are the embedded\nstruct resource of kzalloc'ed resource_entry objects that\npci_free_resource_list() frees when the other bridge is released.\nIn the common case the \"resource collision\" message is garbled; with\nthe slab object poisoned (CONFIG_SLUB_DEBUG) or reused, formatting\nconflict-\u003ename oopses, and KASAN reports a slab-use-after-free read in\ndevm_request_resource().  All of this happens in a probe that is\nalready failing with -EBUSY.  The window is a few hundred instructions\nwide and exists only when two devices actually collide, so the race\nhas not been observed outside of analysis.\n\nDo the same here: take resource_lock, insert with __request_resource()\nand print the diagnostic while the lock still keeps the conflicting\nresource in the tree, then drop the lock.  The return values and the\ndevres handling are unchanged.\n\nThe change was built for x86_64 and RISC-V; the resource KUnit tests\npass on both.\n\nFound by formal verification of kernel/resource.c against the kernel\nbinary.","modified":"2026-12-03T05:00:35.207580081Z","published":"2026-12-03T03:11:26.001Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142792.json","cna_assigner":"Linux"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/132b34e1e7fcc09955bda91ac36e9b6c1126b90c"},{"type":"WEB","url":"https://git.kernel.org/stable/c/14ab6a4761d2e4a02cb6859aee19788f38a24056"},{"type":"WEB","url":"https://git.kernel.org/stable/c/3e8d01c630d3cc781a36cfe29a6c20c0a12bd2d0"},{"type":"WEB","url":"https://git.kernel.org/stable/c/4f071697d1b231c1059b771ef61d4335f1d20d6f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/6cfde28fca86aedb7084ba3dc669153f32ffda83"},{"type":"WEB","url":"https://git.kernel.org/stable/c/995342b317b1ca8a2b55ef4d7849f6a2ba0200ed"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b3d771544f7d77bf191c7cc47c1f3f6feec1e05b"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d2f7bdfdeac8137e942b32e0badc40e181127d7b"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142792.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-142792"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"8d38821cbcf51292cd5a23469d03bd38932a3ba9"},{"fixed":"132b34e1e7fcc09955bda91ac36e9b6c1126b90c"},{"fixed":"3e8d01c630d3cc781a36cfe29a6c20c0a12bd2d0"},{"fixed":"995342b317b1ca8a2b55ef4d7849f6a2ba0200ed"},{"fixed":"4f071697d1b231c1059b771ef61d4335f1d20d6f"},{"fixed":"14ab6a4761d2e4a02cb6859aee19788f38a24056"},{"fixed":"b3d771544f7d77bf191c7cc47c1f3f6feec1e05b"},{"fixed":"6cfde28fca86aedb7084ba3dc669153f32ffda83"},{"fixed":"d2f7bdfdeac8137e942b32e0badc40e181127d7b"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-142792.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.18.0"},{"fixed":"5.10.275"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.226"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.193"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.6.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.117"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.61"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.2"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-142792.json"}}],"schema_version":"1.9.2"}