Linux Kernel Shmem Folio Migration Vulnerability Leading to Xarray Corruption

Vulnerability

A vulnerability in the Linux kernel's memory management migration process can cause corruption in the Xarray multi-index entries. This issue arises when a shmem folio, which can exist in either page cache or swap cache but not both simultaneously, is incorrectly handled during migration. The problem occurs in the folio migration mapping function, where the wrong method is used to determine how many Xarray entries need to be updated. This miscalculation can corrupt the Xarray entries, as it improperly alters the status of sibling entries. The vulnerability could potentially be exploited in userspace, according to available references.

Impact

Exploitation of this vulnerability can lead to memory management errors, specifically Xarray multi-index entry corruption, which could disrupt the proper handling of memory folios and potentially cause further issues in memory management or application stability.

Reproduction

The vulnerability can be reproduced by creating a shmem folio that is placed in swap cache, then triggering the folio migration process. The incorrect handling of the folio's mapping state during this process will cause the Xarray entry corruption.

Added: Jun 9, 2025, 7:46 PM
Updated: Jun 9, 2025, 7:46 PM

Vulnerability Rating

Custom Algorithm
spread
9.0
impact
2.5
exploitability
4.3
remediation
0.0
relevance
0.0
threat
4.8
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.