CVE-2026-99737: mm/shmem: fix truncate loop after boundary swapin failure
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
mm/shmem: fix truncate loop after boundary swapin failure
If swapping in a large entry at the new EOF fails, shmem_undo_range() leaves the entry in place. Its final scan skips the entry, then restarts from the same start index and finds it again. Truncation can loop forever while holding i_rwsem.
Advance start past the skipped entry so that a restarted scan can finish, as we already do for folios that cannot be split.
Note that this does not fix the missing zeroing when boundary swapin fails, it merely prevents the endless loop.
The Linux kernel CVE team has assigned CVE-2026-99737 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.12.69 with commit a99f9a4669a04662c8f9efe0e62cafc598153139 and fixed in 6.12.118 with commit 7f1bbb9c6a8ed3fed72bf7efc906ebe31e92feeb Issue introduced in 6.18.9 with commit b23bee8cdb7aabce5701a7f57414db5a354ae8ed and fixed in 6.18.64 with commit d4d46430852caf5e7dbca1386fc6621ecf8fe2b0 Issue introduced in 6.19 with commit 8a1968bd997f45a9b11aefeabdd1232e1b6c7184 and fixed in 7.3.5 with commit e6e9ba49679e5f33f62615fb57ec103045fbc8f9 Issue introduced in 6.19 with commit 8a1968bd997f45a9b11aefeabdd1232e1b6c7184 and fixed in 7.4-rc2 with commit 5f1ec2cf92a7d655a8eb39711987822f9b1f9d67
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-99737
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:
mm/shmem.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/7f1bbb9c6a8ed3fed72bf7efc906ebe31e92feeb https://git.kernel.org/stable/c/d4d46430852caf5e7dbca1386fc6621ecf8fe2b0 https://git.kernel.org/stable/c/e6e9ba49679e5f33f62615fb57ec103045fbc8f9 https://git.kernel.org/stable/c/5f1ec2cf92a7d655a8eb39711987822f9b1f9d67