{"api_version":"1","generated_at":"2026-11-01T09:41:05+00:00","cve":"CVE-2026-99164","urls":{"html":"https://cve.report/CVE-2026-99164","api":"https://cve.report/api/cve/CVE-2026-99164.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-99164","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-99164"},"summary":{"title":"spi: imx: fix slab corruption from undersized DMA bounce buffers","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nspi: imx: fix slab corruption from undersized DMA bounce buffers\n\nSince commit faa8e404ad8e (\"spi: imx: support dynamic burst length for\nECSPI DMA mode\"), the driver allocates its private DMA TX/RX buffers\nwith kzalloc(dma_len), where dma_len is only rounded up to 4 bytes, but\nmaps, syncs and unmaps them with DMA_CACHE_ALIGNED_LEN(dma_len), i.e.\nrounded up to the cache line size. As a result, the DMA API operates on\nmemory beyond the end of the allocation.\n\nThis was observed on a custom i.MX8MP platform with an mcp251xfd CAN\ncontroller under heavy RPMSG load, as a series of refcount_t warnings\ntriggered from rpmsg_recv_done() in virtio_rpmsg_bus:\n\n  refcount_t: addition on 0; use-after-free.\n  refcount_t: underflow; use-after-free.\n  refcount_t: saturated; leaking memory.\n\nLeading finally to an \"Unable to handle kernel paging request\" oops.\nReproducing this problem took between 30 minutes and roughly 30 hours\nunder the same workload.\n\nHardware watchpoints on the refcount of a struct rpmsg_endpoint showed\nit was overwritten from 2 to 1 by __pi_memcpy_generic() in the\nirq/155-spi2.0 thread. Additionally it was found that a \"normal\"\nrpmsg_recv_done() took 11µs +/-2µs from its kref_get to kref_put. In\nthe error case the same sequence took about 215µs +/-10µs. Based on\nthis, an LLM was used to identify the size mismatch fixed here.\n\nAllocate the buffers with DMA_CACHE_ALIGNED_LEN(dma_len) so they cover\nthe full mapped length, and use the same length for\ndma_sync_single_for_cpu() to stay consistent with map and unmap.\n\nWith this patch applied, the same workload ran for more than 200 hours\nwithout the problem reproducing.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-10-28 11:17:36","updated_at":"2026-10-31 13:17:58"},"problem_types":[],"metrics":[{"version":"3.1","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","type":"Secondary","score":"7.8","severity":"HIGH","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","data":{"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","attackVector":"LOCAL","attackComplexity":"LOW","privilegesRequired":"LOW","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH"}},{"version":"3.1","source":"CNA","type":"DECLARED","score":"7.8","severity":"HIGH","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","data":{"baseScore":7.8,"baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","version":"3.1"}}],"references":[{"url":"https://git.kernel.org/stable/c/59eb22641f0c526dd064390b11cff99ae87c2858","name":"https://git.kernel.org/stable/c/59eb22641f0c526dd064390b11cff99ae87c2858","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/2777f6637da02da84c9c1ff92f413ce0f0995084","name":"https://git.kernel.org/stable/c/2777f6637da02da84c9c1ff92f413ce0f0995084","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-99164","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99164","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected faa8e404ad8e686cb98c51dc507fdcacfb8020ce 2777f6637da02da84c9c1ff92f413ce0f0995084 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected faa8e404ad8e686cb98c51dc507fdcacfb8020ce 59eb22641f0c526dd064390b11cff99ae87c2858 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 7.0","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.0 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.2.13 7.2.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":{"cve_year":"2026","cve_id":"99164","cve":"CVE-2026-99164","epss":"0.001630000","percentile":"0.054820000","score_date":"2026-10-31","updated_at":"2026-11-01 00:01:49"},"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["drivers/spi/spi-imx.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"2777f6637da02da84c9c1ff92f413ce0f0995084","status":"affected","version":"faa8e404ad8e686cb98c51dc507fdcacfb8020ce","versionType":"git"},{"lessThan":"59eb22641f0c526dd064390b11cff99ae87c2858","status":"affected","version":"faa8e404ad8e686cb98c51dc507fdcacfb8020ce","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["drivers/spi/spi-imx.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"7.0"},{"lessThan":"7.0","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"7.2.*","status":"unaffected","version":"7.2.13","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.3","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.2.13","versionStartIncluding":"7.0","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3","versionStartIncluding":"7.0","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nspi: imx: fix slab corruption from undersized DMA bounce buffers\n\nSince commit faa8e404ad8e (\"spi: imx: support dynamic burst length for\nECSPI DMA mode\"), the driver allocates its private DMA TX/RX buffers\nwith kzalloc(dma_len), where dma_len is only rounded up to 4 bytes, but\nmaps, syncs and unmaps them with DMA_CACHE_ALIGNED_LEN(dma_len), i.e.\nrounded up to the cache line size. As a result, the DMA API operates on\nmemory beyond the end of the allocation.\n\nThis was observed on a custom i.MX8MP platform with an mcp251xfd CAN\ncontroller under heavy RPMSG load, as a series of refcount_t warnings\ntriggered from rpmsg_recv_done() in virtio_rpmsg_bus:\n\n  refcount_t: addition on 0; use-after-free.\n  refcount_t: underflow; use-after-free.\n  refcount_t: saturated; leaking memory.\n\nLeading finally to an \"Unable to handle kernel paging request\" oops.\nReproducing this problem took between 30 minutes and roughly 30 hours\nunder the same workload.\n\nHardware watchpoints on the refcount of a struct rpmsg_endpoint showed\nit was overwritten from 2 to 1 by __pi_memcpy_generic() in the\nirq/155-spi2.0 thread. Additionally it was found that a \"normal\"\nrpmsg_recv_done() took 11µs +/-2µs from its kref_get to kref_put. In\nthe error case the same sequence took about 215µs +/-10µs. Based on\nthis, an LLM was used to identify the size mismatch fixed here.\n\nAllocate the buffers with DMA_CACHE_ALIGNED_LEN(dma_len) so they cover\nthe full mapped length, and use the same length for\ndma_sync_single_for_cpu() to stay consistent with map and unmap.\n\nWith this patch applied, the same workload ran for more than 200 hours\nwithout the problem reproducing."}],"metrics":[{"cvssV3_1":{"baseScore":7.8,"baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"scenarios":[{"lang":"en","value":"AV:L - A local caller can issue a 64-byte SPI_IOC_MESSAGE through spidev_ioctl()->spidev_message()->spi_sync()->spi_transfer_one_message()->spi_imx_transfer_one()->spi_imx_dma_transfer()->spi_imx_dma_tx_data_handle(). The faulty length is generated by spi_imx_dma_map(), not supplied by a remote CAN message.\nAC:L - spi_imx_can_dma() accepts caller-controlled transfers of at least 64 bytes; on arm64, 64 bytes deterministically makes spi_imx_dma_map() map 128 bytes after spi_imx_dma_tx_data_handle() allocated 64. The caller can repeat transfers and set word_delay to widen the corruption window without an uncontrollable hardware fault.\nPR:L - spidev_open() and spidev_ioctl() contain no capable() check, so an ordinary account with access to an existing /dev/spidev node can submit the transfer. Independently, can_create() and raw_sendmsg() let an unprivileged local user drive qualifying MCP251xFD CAN-FD SPI transfers on an already-up interface.\nUI:N - The attacker invokes spidev_ioctl() or CAN raw_sendmsg() directly, and those operations reach the faulty DMA mapping without another user mounting media, opening a file, or approving a transfer.\nS:U - spi_imx_dma_map() and spi_imx_dma_unmap() corrupt neighboring allocations in the same host kernel; the path crosses no VM, IOMMU, or other security-authority boundary.\nC:H - The oversized DMA_FROM_DEVICE cache maintenance reverted an adjacent struct rpmsg_endpoint refcount from 2 to 1, allowing __ept_release() to free an endpoint while it remained in use. This demonstrated UAF can expose reclaimed kernel-object contents.\nI:H - spi_imx_dma_unmap() invalidates cache lines beyond the undersized dma_rx_buf, demonstrably altering an adjacent rpmsg_endpoint refcount and creating a UAF. Reclaiming that freed object can convert the slab corruption into attacker-influenced writes or control-flow corruption.\nA:H - The corrupted rpmsg_endpoint refcount produced addition-on-zero, underflow, and saturation warnings and ultimately an Unable to handle kernel paging request oops, demonstrating a kernel crash."}]}],"providerMetadata":{"dateUpdated":"2026-10-31T12:44:24.973Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/2777f6637da02da84c9c1ff92f413ce0f0995084"},{"url":"https://git.kernel.org/stable/c/59eb22641f0c526dd064390b11cff99ae87c2858"}],"title":"spi: imx: fix slab corruption from undersized DMA bounce buffers","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-99164","datePublished":"2026-10-28T10:35:16.694Z","dateReserved":"2026-09-25T10:25:14.398Z","dateUpdated":"2026-10-31T12:44:24.973Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-10-28 11:17:36","lastModifiedDate":"2026-10-31 13:17:58","problem_types":[],"metrics":{"cvssMetricV31":[{"source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","type":"Secondary","cvssData":{"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","attackVector":"LOCAL","attackComplexity":"LOW","privilegesRequired":"LOW","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH"},"exploitabilityScore":1.8,"impactScore":5.9}]},"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"99164","Ordinal":"1","Title":"spi: imx: fix slab corruption from undersized DMA bounce buffers","CVE":"CVE-2026-99164","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"99164","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nspi: imx: fix slab corruption from undersized DMA bounce buffers\n\nSince commit faa8e404ad8e (\"spi: imx: support dynamic burst length for\nECSPI DMA mode\"), the driver allocates its private DMA TX/RX buffers\nwith kzalloc(dma_len), where dma_len is only rounded up to 4 bytes, but\nmaps, syncs and unmaps them with DMA_CACHE_ALIGNED_LEN(dma_len), i.e.\nrounded up to the cache line size. As a result, the DMA API operates on\nmemory beyond the end of the allocation.\n\nThis was observed on a custom i.MX8MP platform with an mcp251xfd CAN\ncontroller under heavy RPMSG load, as a series of refcount_t warnings\ntriggered from rpmsg_recv_done() in virtio_rpmsg_bus:\n\n  refcount_t: addition on 0; use-after-free.\n  refcount_t: underflow; use-after-free.\n  refcount_t: saturated; leaking memory.\n\nLeading finally to an \"Unable to handle kernel paging request\" oops.\nReproducing this problem took between 30 minutes and roughly 30 hours\nunder the same workload.\n\nHardware watchpoints on the refcount of a struct rpmsg_endpoint showed\nit was overwritten from 2 to 1 by __pi_memcpy_generic() in the\nirq/155-spi2.0 thread. Additionally it was found that a \"normal\"\nrpmsg_recv_done() took 11µs +/-2µs from its kref_get to kref_put. In\nthe error case the same sequence took about 215µs +/-10µs. Based on\nthis, an LLM was used to identify the size mismatch fixed here.\n\nAllocate the buffers with DMA_CACHE_ALIGNED_LEN(dma_len) so they cover\nthe full mapped length, and use the same length for\ndma_sync_single_for_cpu() to stay consistent with map and unmap.\n\nWith this patch applied, the same workload ran for more than 200 hours\nwithout the problem reproducing.","Type":"Description","Title":"spi: imx: fix slab corruption from undersized DMA bounce buffers"}]}}}