CVE-2026-99737: mm/shmem: fix truncate loop after boundary swapin failure
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, shmemundorange() 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 irwsem.
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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.192-2Fixed in 7.3.5-1
Event History
Frequently Asked Questions
What conditions are required to trigger the infinite truncation loop?
The failure occurs when truncating shmem and swapping in a large entry at the new end-of-file boundary fails. The entry is left in place, causing the final scan to restart at the same index and repeatedly encounter it while holding i_rwsem.
What is the practical impact of the issue?
Truncation can loop indefinitely while holding i_rwsem. This can block operations that need that inode read-write semaphore.
Does this fix address all consequences of a boundary swapin failure?
No. The fix prevents the endless truncation loop by advancing the scan start past the skipped entry, but it does not fix the missing zeroing when boundary swapin fails.