{"id":"CVE-2026-23390","summary":"tracing/dma: Cap dma_map_sg tracepoint arrays to prevent buffer overflow","details":"In the Linux kernel, the following vulnerability has been resolved:\n\ntracing/dma: Cap dma_map_sg tracepoint arrays to prevent buffer overflow\n\nThe dma_map_sg tracepoint can trigger a perf buffer overflow when\ntracing large scatter-gather lists. With devices like virtio-gpu\ncreating large DRM buffers, nents can exceed 1000 entries, resulting\nin:\n\n  phys_addrs: 1000 * 8 bytes = 8,000 bytes\n  dma_addrs:  1000 * 8 bytes = 8,000 bytes\n  lengths:    1000 * 4 bytes = 4,000 bytes\n  Total: ~20,000 bytes\n\nThis exceeds PERF_MAX_TRACE_SIZE (8192 bytes), causing:\n\n  WARNING: CPU: 0 PID: 5497 at kernel/trace/trace_event_perf.c:405\n  perf buffer not large enough, wanted 24620, have 8192\n\nCap all three dynamic arrays at 128 entries using min() in the array\nsize calculation. This ensures arrays are only as large as needed\n(up to the cap), avoiding unnecessary memory allocation for small\noperations while preventing overflow for large ones.\n\nThe tracepoint now records the full nents/ents counts and a truncated\nflag so users can see when data has been capped.\n\nChanges in v2:\n- Use min(nents, DMA_TRACE_MAX_ENTRIES) for dynamic array sizing\n  instead of fixed DMA_TRACE_MAX_ENTRIES allocation (feedback from\n  Steven Rostedt)\n- This allocates only what's needed up to the cap, avoiding waste\n  for small operations\n\nReviwed-by: Sean Anderson \u003csean.anderson@linux.dev\u003e","modified":"2026-04-02T13:12:23.811946Z","published":"2026-03-25T10:29:02.768Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/23xxx/CVE-2026-23390.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/02d209bb018a40dee9eac89e91860253dee9605b"},{"type":"WEB","url":"https://git.kernel.org/stable/c/daafcc0ef0b358d9d622b6e3b7c43767aa3814ee"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f2584f791a10343bdc995ff6ff402db45b95de69"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/23xxx/CVE-2026-23390.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-23390"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"038eb433dc1474c4bc7d33188294e3d4778efdfd"},{"fixed":"02d209bb018a40dee9eac89e91860253dee9605b"},{"fixed":"f2584f791a10343bdc995ff6ff402db45b95de69"},{"fixed":"daafcc0ef0b358d9d622b6e3b7c43767aa3814ee"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23390.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.12.0"},{"fixed":"6.12.74"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.13"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23390.json"}}],"schema_version":"1.7.5"}