{"id":"AZL-117157","summary":"CVE-2026-139460 affecting package kernel 6.6.161.1-1","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nPCI/P2PDMA: Do not tear down the allocate attribute on registration failure\n\npci_p2pdma_add_resource() installs pci_p2pdma_unmap_mappings() as a devres\naction with the devres allocated p2p_pgmap as its data, and only then adds\nthe range to the pool:\n\n  error = devm_add_action_or_reset(&pdev-\u003edev, pci_p2pdma_unmap_mappings,\n                                   p2p_pgmap);\n  if (error)\n          goto pages_free;\n\n  p2pdma = rcu_dereference_protected(pdev-\u003ep2pdma, 1);\n  error = gen_pool_add_owner(p2pdma-\u003epool, ...);\n  if (error)\n          goto pages_free;\n\nThe action removes the allocate attribute for the whole device, which tears\ndown existing userspace mappings of every BAR already registered on it.\nBoth failures here get that wrong, in opposite ways.\n\ndevm_add_action_or_reset() runs the action when it cannot allocate its\ndevres node, so an -ENOMEM while registering a second BAR unmaps the first\none. Use devm_add_action() and let the error path unwind only what this\ncall created.\n\ngen_pool_add_owner() allocates a chunk and can also fail with -ENOMEM.\nThere the action is registered, and the error path frees p2p_pgmap with\ndevm_kfree() while leaving the action pointing at it. On unbind devres\nruns the action and pci_p2pdma_unmap_mappings() dereferences\np2p_pgmap-\u003emem-\u003eowner-\u003ekobj, which is freed memory. Give that failure its\nown label and drop the action with devm_remove_action(), which removes it\nwithout running it.","modified":"2026-12-01T14:17:41.632594012Z","published":"2026-11-30T14:19:17Z","upstream":["CVE-2026-139460"],"references":[{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139460"}],"affected":[{"package":{"name":"kernel","ecosystem":"Azure Linux:3","purl":"pkg:rpm/azure-linux/kernel"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"6.6.161.1-1"}]}],"database_specific":{"source":"https://github.com/microsoft/AzureLinuxVulnerabilityData/blob/main/osv/AZL-117157.json"}}],"schema_version":"1.9.2"}