CVE-2026-98242: dma-buf: Fix silent overflow for phys vec to sgt
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
dma-buf: Fix silent overflow for phys vec to sgt
In case MMIO size is bigger than 4G and peer2peer DMA goes through host bridge, we trigger a code path that assigns the total linked IOVA (which is greater than 4G) to mapped_len.
Previously, mapped_len was declared as 32-bit unsigned int. When accumulating size_t lengths, this leads to a silent wrap-around. This truncation causes truncated lengths to be passed to functions like fill_sg_entry().
Fix this by changing mapped_len to size_t (64-bit). While at it, fix similar potential overflow issues in calc_sg_nents by using check_add_overflow() for nents and using unsigned int for the loop iterator in fill_sg_entry to match.
The Linux kernel CVE team has assigned CVE-2026-98242 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.19 with commit 3aa31a8bb11e47c0ff2b306988d1756b810c1c3c and fixed in 7.2.8 with commit 6b98fd7106d4e486f432664893dcd4d6fa3a9693 Issue introduced in 6.19 with commit 3aa31a8bb11e47c0ff2b306988d1756b810c1c3c and fixed in 7.3-rc4 with commit b344ca94e8cc85796f16ea25e2e5a8e0303fe813
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-98242
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/dma-buf/dma-buf-mapping.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/6b98fd7106d4e486f432664893dcd4d6fa3a9693 https://git.kernel.org/stable/c/b344ca94e8cc85796f16ea25e2e5a8e0303fe813