CVE-2026-23390: tracing/dma: Cap dma_map_sg tracepoint arrays to prevent buffer overflow
In the Linux kernel, the following vulnerability has been resolved:
tracing/dma: Cap dmamapsg tracepoint arrays to prevent buffer overflow
The dmamapsg 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:
physaddrs: 1000 8 bytes = 8,000 bytes dmaaddrs: 1000 8 bytes = 8,000 bytes lengths: 1000 4 bytes = 4,000 bytes Total: ~20,000 bytes
This exceeds PERFMAXTRACESIZE (8192 bytes), causing:
WARNING: CPU: 0 PID: 5497 at kernel/trace/traceeventperf.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, DMATRACEMAXENTRIES) for dynamic array sizing instead of fixed DMATRACEMAXENTRIES 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>
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Cap all three dynamic arrays (phys_addrs, dma_addrs, and lengths) at 128 entries by using min(nents, DMA_TRACE_MAX_ENTRIES) in the array size calculation; record the full nents/ents counts and a truncated flag when data is capped.
Linux kernel tracing/dma dma_map_sg tracepoint dynamic array sizing = min(nents, DMA_TRACE_MAX_ENTRIES), with DMA_TRACE_MAX_ENTRIES capped at 128
Event History
Frequently Asked Questions
What is the severity of CVE-2026-23390?
CVE-2026-23390 is classified as a high severity vulnerability due to its potential to lead to a buffer overflow.
How do I fix CVE-2026-23390?
To fix CVE-2026-23390, you should update to the latest version of the Linux kernel where this vulnerability has been patched.
What specific issue does CVE-2026-23390 address?
CVE-2026-23390 addresses a vulnerability in the Linux kernel related to the dma_map_sg tracepoint which could lead to a perf buffer overflow.
What versions of the Linux kernel are affected by CVE-2026-23390?
CVE-2026-23390 affects various versions of the Linux kernel where the dma_map_sg tracepoint feature is present.
Is exploitation of CVE-2026-23390 easy for an attacker?
While the exploitation of CVE-2026-23390 may require specific conditions, it poses a significant risk if successfully executed.