{"id":"CVE-2026-90012","summary":"spi: Fix DMA mapping ownership on partial map failure","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nspi: Fix DMA mapping ownership on partial map failure\n\nIf RX mapping fails after TX mapping succeeds, __spi_map_msg() unmaps\nTX but leaves tx_sg_mapped set. If TX mapping fails on a later\ntransfer, mappings created for earlier transfers remain active.\n\nIn both cases, cur_{tx,rx}_dma_dev have not yet been updated because they\nare assigned only after every transfer has been mapped. The subsequent\nspi_unmap_msg() may therefore unmap the TX mapping again or release\nearlier mappings using a NULL or stale device. Using a NULL device can\ntrigger an oops. An empty SG table does not prevent the NULL dereference\nbecause dma_unmap_sg_attrs() accesses the device before checking the\nentry count.\n\nPublish both mapping devices before mapping starts and unwind all\nfailures through __spi_unmap_msg(). This clears the mapping flags and\nreleases each mapping once with the device that created it.\n\nPublishing the devices before the loop also refreshes them when no\ntransfer needs mapping. No mapping flag is set in that case, so current\nusers do not use the pointers as mapping owners.","modified":"2026-09-18T03:48:34.664535120Z","published":"2026-09-16T10:33:19.463Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/90xxx/CVE-2026-90012.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/367cea239fc93094e5c16a72724800e0358f5c46"},{"type":"WEB","url":"https://git.kernel.org/stable/c/5def8b6aaad44603740786262b95b6f77df52a1c"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a38051fa2ddedbc8ec15292c55e276880ec5b9a4"},{"type":"WEB","url":"https://git.kernel.org/stable/c/cc8354213ad6bd5fb8cc05a3fa3701188d086626"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/90xxx/CVE-2026-90012.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-90012"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"e289df82344fecc104ad8326b9ab6da612b9c899"},{"fixed":"cc8354213ad6bd5fb8cc05a3fa3701188d086626"},{"fixed":"a38051fa2ddedbc8ec15292c55e276880ec5b9a4"},{"fixed":"5def8b6aaad44603740786262b95b6f77df52a1c"},{"fixed":"367cea239fc93094e5c16a72724800e0358f5c46"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-90012.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.11.0"},{"fixed":"6.12.110"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.51"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.2.5"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-90012.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}]}