# CVE-2026-23390: tracing/dma: Cap dma_map_sg tracepoint arrays to prevent buffer overflow

- Severity: High 7.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.15%, higher than 4% of CVEs (2026-12-01)
- Published: 2026-03-25T10:29:02.768Z
- Modified: 2026-06-17T10:21:29.223Z
- Weaknesses: CWE-787
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

tracing/dma: Cap dma_map_sg tracepoint arrays to prevent buffer overflow

The dma_map_sg tracepoint can trigger a perf buffer overflow when
tracing large scatter-gather lists. With devices like virtio-gpu
creating large DRM buffers, nents can exceed 1000 entries, resulting
in:

  phys_addrs: 1000 * 8 bytes = 8,000 bytes
  dma_addrs:  1000 * 8 bytes = 8,000 bytes
  lengths:    1000 * 4 bytes = 4,000 bytes
  Total: ~20,000 bytes

This exceeds PERF_MAX_TRACE_SIZE (8192 bytes), causing:

  WARNING: CPU: 0 PID: 5497 at kernel/trace/trace_event_perf.c:405
  perf buffer not large enough, wanted 24620, have 8192

Cap all three dynamic arrays at 128 entries using min() in the array
size calculation. This ensures arrays are only as large as needed
(up to the cap), avoiding unnecessary memory allocation for small
operations while preventing overflow for large ones.

The tracepoint now records the full nents/ents counts and a truncated
flag so users can see when data has been capped.

Changes in v2:
- Use min(nents, DMA_TRACE_MAX_ENTRIES) for dynamic array sizing
  instead of fixed DMA_TRACE_MAX_ENTRIES allocation (feedback from
  Steven Rostedt)
- This allocates only what's needed up to the cap, avoiding waste
  for small operations

Reviwed-by: Sean Anderson <sean.anderson@linux.dev>

(As written by CVE List.)

## Affected

- Linux Linux: from 038eb433dc1474c4bc7d33188294e3d4778efdfd before 02d209bb018a40dee9eac89e91860253dee9605b; from 038eb433dc1474c4bc7d33188294e3d4778efdfd before f2584f791a10343bdc995ff6ff402db45b95de69; from 038eb433dc1474c4bc7d33188294e3d4778efdfd before daafcc0ef0b358d9d622b6e3b7c43767aa3814ee; 6.12 (not affected: before 6.12; from 6.12.74 up to 6.12.*; from 6.18.13 up to 6.18.*; from 6.19 up to *)
- linux linux_kernel: from 6.12.1 before 6.12.74; from 6.13 before 6.18.13; 6.12; 6.19

## References

- <https://git.kernel.org/stable/c/02d209bb018a40dee9eac89e91860253dee9605b> (patch)
- <https://git.kernel.org/stable/c/f2584f791a10343bdc995ff6ff402db45b95de69> (patch)
- <https://git.kernel.org/stable/c/daafcc0ef0b358d9d622b6e3b7c43767aa3814ee> (patch)

## Sources

- CVE List: [CVE-2026-23390](https://www.cve.org/CVERecord?id=CVE-2026-23390), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2026-23390](https://nvd.nist.gov/vuln/detail/CVE-2026-23390), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-23390 · Whole record: https://cve.day/CVE-2026-23390.json · Rebuilt by cve.day 2026-11-25T22:59:16.708Z
