CVE-2026-143388: dma-buf: Restore the scatterlist entry count before freeing
In the Linux kernel, the following vulnerability has been resolved:
dma-buf: Restore the scatterlist entry count before freeing
dmabufphysvectosgt() clears orignents to mark the returned table as DMA-only. Since sgfreetable() uses orignents to walk and free the scatterlist, dmabuffreesgt() leaks the allocation on every successful map/unmap cycle.
Restore orignents from nents before freeing the table. The helper allocates the DMA list directly, so nents retains the allocation count, including for chained scatterlists.
The reported kmemleak output was:
KMEMLEAK LEAK: 2 driver-related leak(s) KMEMLEAK LEAK: unreferenced object 0xff11000125ceff00 (size 32): KMEMLEAK LEAK: comm dtr, pid 4432, jiffies 4295031027 KMEMLEAK LEAK: hex dump (first 32 bytes): KMEMLEAK LEAK: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ KMEMLEAK LEAK: 00 00 01 00 28 38 00 00 00 10 00 00 00 00 00 00 ....(8.......... KMEMLEAK LEAK: backtrace (crc 4e8077f2): KMEMLEAK LEAK: kmallocnoprof+0x451/0x8b0 KMEMLEAK LEAK: sgalloctable+0x2a0/0x4d0 KMEMLEAK LEAK: sgalloctable+0x24/0x170 KMEMLEAK LEAK: dmabufphysvectosgt+0x84f/0xed0 KMEMLEAK LEAK: 0xffffffffa1ad21a8 KMEMLEAK LEAK: dmabufmapattachment+0x138/0x690 KMEMLEAK LEAK: ibumemdmabufmappages+0x249/0xc90 [ibcore] KMEMLEAK LEAK: 0xffffffffa138f8d2 KMEMLEAK LEAK: 0xffffffffa1396abe KMEMLEAK LEAK: 0xffffffffa1331a5f KMEMLEAK LEAK: 0xffffffffa13320dd KMEMLEAK LEAK: 0xffffffffa1ad696d KMEMLEAK LEAK: 0xffffffffa1acecc7 KMEMLEAK LEAK: 0xffffffffa1acfd17 KMEMLEAK LEAK: x64sysioctl+0x72c/0x11f0 KMEMLEAK LEAK: dosyscall64+0xa1/0x4f0 KMEMLEAK LEAK: unreferenced object 0xff1100016dbf3a80 (size 32): KMEMLEAK LEAK: comm dtr, pid 4432, jiffies 4295034705 KMEMLEAK LEAK: hex dump (first 32 bytes): KMEMLEAK LEAK: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ KMEMLEAK LEAK: 00 20 10 00 28 38 00 00 00 10 00 00 00 00 00 00 . ..(8..........
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In dma_buf_free_sgt(), restore orig_nents from nents before freeing the scatterlist table, including for chained scatterlists.
Event History
Frequently Asked Questions
Which systems are affected in practice?
Linux kernel systems that use dma_buf_phys_vec_to_sgt() and subsequently free the returned scatter-gather table through dma_buf_free_sgt() are affected. The leak occurs on every successful map/unmap cycle using this path.
What is the impact of repeated use?
Each affected successful map/unmap cycle leaks the scatterlist allocation because the original entry count is cleared before freeing. Repeated cycles can accumulate unreclaimed kernel memory.
How can I determine whether the issue is occurring?
Kernel memory-leak reporting can show unreferenced allocations with a backtrace including __sg_alloc_table, sg_alloc_table, and dma_buf_phys_vec_to_sgt. The reported example identified the leaking task as "dtr" and classified the objects as driver-related leaks.