{"id":"CVE-2026-143388","state":"PUBLISHED","title":"dma-buf: Restore the scatterlist entry count before freeing","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ndma-buf: Restore the scatterlist entry count before freeing\n\ndma_buf_phys_vec_to_sgt() clears orig_nents to mark the returned table\nas DMA-only. Since sg_free_table() uses orig_nents to walk and free the\nscatterlist, dma_buf_free_sgt() leaks the allocation on every successful\nmap/unmap cycle.\n\nRestore orig_nents from nents before freeing the table. The helper\nallocates the DMA list directly, so nents retains the allocation count,\nincluding for chained scatterlists.\n\nThe reported kmemleak output was:\n\nKMEMLEAK LEAK: 2 driver-related leak(s)\nKMEMLEAK LEAK: unreferenced object 0xff11000125ceff00 (size 32):\nKMEMLEAK LEAK:   comm dtr, pid 4432, jiffies 4295031027\nKMEMLEAK LEAK:   hex dump (first 32 bytes):\nKMEMLEAK LEAK:     02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................\nKMEMLEAK LEAK:     00 00 01 00 28 38 00 00 00 10 00 00 00 00 00 00  ....(8..........\nKMEMLEAK LEAK:   backtrace (crc 4e8077f2):\nKMEMLEAK LEAK:     __kmalloc_noprof+0x451/0x8b0\nKMEMLEAK LEAK:     __sg_alloc_table+0x2a0/0x4d0\nKMEMLEAK LEAK:     sg_alloc_table+0x24/0x170\nKMEMLEAK LEAK:     dma_buf_phys_vec_to_sgt+0x84f/0xed0\nKMEMLEAK LEAK:     0xffffffffa1ad21a8\nKMEMLEAK LEAK:     dma_buf_map_attachment+0x138/0x690\nKMEMLEAK LEAK:     ib_umem_dmabuf_map_pages+0x249/0xc90 [ib_core]\nKMEMLEAK LEAK:     0xffffffffa138f8d2\nKMEMLEAK LEAK:     0xffffffffa1396abe\nKMEMLEAK LEAK:     0xffffffffa1331a5f\nKMEMLEAK LEAK:     0xffffffffa13320dd\nKMEMLEAK LEAK:     0xffffffffa1ad696d\nKMEMLEAK LEAK:     0xffffffffa1acecc7\nKMEMLEAK LEAK:     0xffffffffa1acfd17\nKMEMLEAK LEAK:     __x64_sys_ioctl+0x72c/0x11f0\nKMEMLEAK LEAK:     do_syscall_64+0xa1/0x4f0\nKMEMLEAK LEAK: unreferenced object 0xff1100016dbf3a80 (size 32):\nKMEMLEAK LEAK:   comm dtr, pid 4432, jiffies 4295034705\nKMEMLEAK LEAK:   hex dump (first 32 bytes):\nKMEMLEAK LEAK:     02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................\nKMEMLEAK LEAK:     00 20 10 00 28 38 00 00 00 10 00 00 00 00 00 00  . ..(8..........","publishedAt":"2026-12-03T09:22:32.173Z","updatedAt":"2026-12-03T09:22:32.173Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3aa31a8bb11e47c0ff2b306988d1756b810c1c3c","status":"affected","lessThan":"49698d8985e029879a3b3df60d5d6b5e92aa4c45","versionType":"git"},{"version":"3aa31a8bb11e47c0ff2b306988d1756b810c1c3c","status":"affected","lessThan":"052947a3b5e7402eaad53379dfec2ecab27a2d80","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/dma-buf/dma-buf-mapping.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.19","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/dma-buf/dma-buf-mapping.c"]}],"references":["https://git.kernel.org/stable/c/49698d8985e029879a3b3df60d5d6b5e92aa4c45","https://git.kernel.org/stable/c/052947a3b5e7402eaad53379dfec2ecab27a2d80"],"weaknesses":[],"ingestedAt":"2026-12-03T09:44:04.436Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143388.json","commit":"9e309c7c0f08856e2558a1df33f75dca027fab70","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143388","state":"PUBLISHED","datePublished":"2026-12-03T09:22:32.173Z","dateUpdated":"2026-12-03T09:22:32.173Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.372Z"},"containers":{"cna":{"title":"dma-buf: Restore the scatterlist entry count before freeing","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ndma-buf: Restore the scatterlist entry count before freeing\n\ndma_buf_phys_vec_to_sgt() clears orig_nents to mark the returned table\nas DMA-only. Since sg_free_table() uses orig_nents to walk and free the\nscatterlist, dma_buf_free_sgt() leaks the allocation on every successful\nmap/unmap cycle.\n\nRestore orig_nents from nents before freeing the table. The helper\nallocates the DMA list directly, so nents retains the allocation count,\nincluding for chained scatterlists.\n\nThe reported kmemleak output was:\n\nKMEMLEAK LEAK: 2 driver-related leak(s)\nKMEMLEAK LEAK: unreferenced object 0xff11000125ceff00 (size 32):\nKMEMLEAK LEAK:   comm dtr, pid 4432, jiffies 4295031027\nKMEMLEAK LEAK:   hex dump (first 32 bytes):\nKMEMLEAK LEAK:     02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................\nKMEMLEAK LEAK:     00 00 01 00 28 38 00 00 00 10 00 00 00 00 00 00  ....(8..........\nKMEMLEAK LEAK:   backtrace (crc 4e8077f2):\nKMEMLEAK LEAK:     __kmalloc_noprof+0x451/0x8b0\nKMEMLEAK LEAK:     __sg_alloc_table+0x2a0/0x4d0\nKMEMLEAK LEAK:     sg_alloc_table+0x24/0x170\nKMEMLEAK LEAK:     dma_buf_phys_vec_to_sgt+0x84f/0xed0\nKMEMLEAK LEAK:     0xffffffffa1ad21a8\nKMEMLEAK LEAK:     dma_buf_map_attachment+0x138/0x690\nKMEMLEAK LEAK:     ib_umem_dmabuf_map_pages+0x249/0xc90 [ib_core]\nKMEMLEAK LEAK:     0xffffffffa138f8d2\nKMEMLEAK LEAK:     0xffffffffa1396abe\nKMEMLEAK LEAK:     0xffffffffa1331a5f\nKMEMLEAK LEAK:     0xffffffffa13320dd\nKMEMLEAK LEAK:     0xffffffffa1ad696d\nKMEMLEAK LEAK:     0xffffffffa1acecc7\nKMEMLEAK LEAK:     0xffffffffa1acfd17\nKMEMLEAK LEAK:     __x64_sys_ioctl+0x72c/0x11f0\nKMEMLEAK LEAK:     do_syscall_64+0xa1/0x4f0\nKMEMLEAK LEAK: unreferenced object 0xff1100016dbf3a80 (size 32):\nKMEMLEAK LEAK:   comm dtr, pid 4432, jiffies 4295034705\nKMEMLEAK LEAK:   hex dump (first 32 bytes):\nKMEMLEAK LEAK:     02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................\nKMEMLEAK LEAK:     00 20 10 00 28 38 00 00 00 10 00 00 00 00 00 00  . ..(8.........."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3aa31a8bb11e47c0ff2b306988d1756b810c1c3c","status":"affected","lessThan":"49698d8985e029879a3b3df60d5d6b5e92aa4c45","versionType":"git"},{"version":"3aa31a8bb11e47c0ff2b306988d1756b810c1c3c","status":"affected","lessThan":"052947a3b5e7402eaad53379dfec2ecab27a2d80","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/dma-buf/dma-buf-mapping.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.19","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/dma-buf/dma-buf-mapping.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/49698d8985e029879a3b3df60d5d6b5e92aa4c45"},{"url":"https://git.kernel.org/stable/c/052947a3b5e7402eaad53379dfec2ecab27a2d80"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:22:32.173Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.19","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.19","versionEndExcluding":"7.4-rc2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}