CVE-2026-99736 in Linuxinfo

Summary

by MITRE • 11/20/2026

In the Linux kernel, the following vulnerability has been resolved:

mm/shmem: fix accounting of swapin-error markers

A failed swap read replaces the swap entry with a swapin-error marker in the page-cache and subtracts its pages from "alloced" and "swapped"; however, it leaves their block charge in place.

Removing the marker during truncate then subtracts from "swapped" again. This can underflow the counters or make swapped reach zero while other pages remain swapped out, causing swapoff to loop without finding them.

When installing the marker, subtract only from "swapped" and let shmem_recalc_inode() reduce "alloced" and release the block charge.

Make shmem_free_swap() report successful removal separately from the number of swap pages freed, so removing a swapin-error marker does not subtract from "swapped" again.

It's a bit confusing, but replacing a swapped out page by a swapin-error marker in shmem_set_folio_swapin_error() behaves as follows:

Initially: alloced=1, swapped=1, nrpages=0 Calling shmem_recalc_inode(inode, 0, -1) -> swapped = 0 -> freed = 1 - 0 - 0 = 1 -> alloced -= freed -> alloced=0, swapped=0, block charge released

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 11/20/2026

The Linux kernel's shared memory subsystem contains a critical accounting flaw within the swap-in error handling logic that can lead to severe system instability. This vulnerability arises from an inconsistency in how page cache entries are tracked when a swap read operation fails and is replaced by a special swapin-error marker. Under normal circumstances, when a failed swap read occurs, the kernel replaces the original swap entry with this error marker within the page-cache structure. The current implementation incorrectly subtracts the associated pages from both the allocated count and the swapped-out counter while simultaneously leaving the underlying block charge in place. This initial state creates an imbalance where the accounting metadata does not accurately reflect the actual resource usage, setting the stage for subsequent errors during file truncation or cleanup operations.

The severity of this issue becomes apparent when a truncate operation is performed on the affected inode. During truncation, the kernel attempts to remove the swapin-error marker from the page cache. Due to the flawed logic described above, this removal process incorrectly subtracts from the swapped counter again. This double subtraction can cause integer underflow in the accounting counters or force the swapped count to reach zero while other pages remain genuinely swapped out on disk. Such a discrepancy breaks the internal consistency of the kernel's memory management subsystem, leading to unpredictable behavior that affects system stability and resource tracking accuracy.

The operational impact of this vulnerability is particularly dangerous during swapoff operations. When the system attempts to disable swapping or reconfigure swap space, it relies on accurate accounting data to locate all pages currently residing in swap storage. Because the underflowed counters falsely indicate that no pages are swapped out when there actually are, the swapoff process may enter an infinite loop as it fails to find and release these lingering resources. This can result in a hung system state where critical memory management tasks stall indefinitely, potentially requiring a hard reset or causing significant service disruption for running workloads dependent on shared memory segments.

To resolve this issue, the fix modifies the behavior of shmem_set_folio_swapin_error() to ensure proper accounting at the point of marker installation rather than during subsequent cleanup phases. Specifically, when installing the error marker, only the swapped counter is decremented, while the allocation and block charge adjustments are deferred to shmem_recalc_inode(). This function correctly reduces the allocated count and releases the associated block charge in a single coherent step. Additionally, shmem_free_swap() has been updated to report successful removal separately from the number of swap pages freed. By decoupling these metrics, removing a swapin-error marker no longer triggers an erroneous subtraction from the swapped counter, thereby preserving the integrity of memory accounting statistics and preventing underflow conditions that lead to system hangs during swap management operations.

Responsible

Linux

Reservation

09/25/2026

Disclosure

11/20/2026

Moderation

accepted

CPE

ready

EPSS

0.00156

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!