CVE-2026-23161

Medium

In the Linux kernel, the following vulnerability has been resolved: mm/shmem, swap: fix race of truncate and swap entry split The helper for shmem swap freeing is not handling the order of swap entries correctly. It uses xa_cmpxchg_irq to erase the swap entry, but it gets the entry order before that using xa_get_order without lock protection, and it may get an outdated order value if the entry is split or changed in other ways after the xa_get_order and before the xa_cmpxchg_irq. And besides, the order could grow and be larger than expected, and cause truncation to erase data beyond the end border. For example, if the target entry and following entries are swapped in or freed, then a large folio was added in place and swapped out, using the same entry, the xa_cmpxchg_irq will still succeed, it's very unlikely to happen though. To fix that, open code the Xarray cmpxchg and put the order retrieval and value checking in the same critical section. Also, ensure the order won't exceed the end border, skip it if the entry goes across the border. Skipping large swap entries crosses the end border is safe here. Shmem truncate iterates the range twice, in the first iteration, find_lock_entries already filtered such entries, and shmem will swapin the entries that cross the end border and partially truncate the folio (split the folio or at least zero part of it). So in the second loop here, if we see a swap entry that crosses the end order, it must at least have its content erased already. I observed random swapoff hangs and kernel panics when stress testing ZSWAP with shmem. After applying this patch, all problems are gone.

Package Linux Kernel
Published 2026-02-14
Last modified 2026-04-03
CVSS version 3.1
Patch available
Yes

CVSS 3.1 score

4.7

out of 10
Medium
Attack Vector
Local
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
High
Vector string
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H

Weakness type

CWE-362

CVE-2026-23161 is a Race Condition vulnerability

What is Race Condition?

The product contains a code sequence that can run concurrently with other code, creating unexpected states. Learn more on MITRE CWE

Affected versions

Linux kernel versions 6.12 and later are affected. Fixed in 6.12.69, 6.18.9, 6.19 and their respective stable series.

Affected from
≥ 6.12
Fixed in
✓ 6.12.69 6.12.x ✓ 6.18.9 6.18.x ✓ 6.19

References

The following references provide additional information about CVE-2026-23161 including vendor advisories, patch commits, exploit details, and third-party analysis. Links are sourced from the NIST NVD database.

Frequently asked questions

  • What is CVE-2026-23161?

    CVE-2026-23161 is a Medium severity Linux kernel vulnerability with a CVSS score of 4.7 out of 10 , classified as a Race Condition flaw (CWE-362) . It affects Linux kernel versions from 6.12 onward and has been patched in 6.12.69, 6.18.9 and 6.19. CVE-2026-23161 has not been confirmed as actively exploited and is not listed in the CISA KEV catalog.

  • What is the CVSS score for CVE-2026-23161?

    CVE-2026-23161 has a CVSS score of 4.7 out of 10, rated Medium severity (CVSS 3.1). The vector string is CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H .

  • Is there a patch available for CVE-2026-23161?

    Yes — CVE-2026-23161 has been patched. Fixed versions include 6.12.69, 6.18.9 and 6.19. If you are running Linux kernel 6.12 or later up to the fix versions, apply the relevant patch for your kernel branch.

  • Is CVE-2026-23161 actively exploited?

    No — CVE-2026-23161 has not been confirmed as actively exploited. It is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.

  • What is Race Condition (CWE-362)?

    The product contains a code sequence that can run concurrently with other code, creating unexpected states. View CWE-362 on MITRE CWE →