LiveActive security incident?Get immediate response
CVE Record

CVE-2024-26960: mm: swap: fix race between free_swap_and_cache() and swapoff()

In the Linux kernel, the following vulnerability has been resolved: mm: swap: fix race between free_swap_and_cache() and swapoff() There was previously a theoretical window where swapoff() could run and teardown a swap_info_struct while a call to free_swap_and_cache() was running in another thread. This could cause, amongst other bad possibilities, swap_page_trans_huge_swapped() (called by free_swap_and_cache()) to access the freed memory for swap_map. This is a theoretical problem and I haven't been able to provoke it from a test case. But there has been agreement based on code review that this is possible (see link below). Fix it by using get_swap_device()/put_swap_device(), which will stall swapoff(). There was an extra check in _swap_info_get() to confirm that the swap entry was not free. This isn't present in get_swap_device() because it doesn't make sense in general due to the race between getting the reference and swapoff. So I've added an equivalent check directly in free_swap_and_cache(). Details of how to provoke one possible issue (thanks to David Hildenbrand for deriving this): --8<----- __swap_entry_free() might be the last user and result in "count == SWAP_HAS_CACHE". swapoff->try_to_unuse() will stop as soon as soon as si->inuse_pages==0. So the question is: could someone reclaim the folio and turn si->inuse_pages==0, before we completed swap_page_trans_huge_swapped(). Imagine the following: 2 MiB folio in the swapcache. Only 2 subpages are still references by swap entries. Process 1 still references subpage 0 via swap entry. Process 2 still references subpage 1 via swap entry. Process 1 quits. Calls free_swap_and_cache(). -> count == SWAP_HAS_CACHE [then, preempted in the hypervisor etc.] Process 2 quits. Calls free_swap_and_cache(). -> count == SWAP_HAS_CACHE Process 2 goes ahead, passes swap_page_trans_huge_swapped(), and calls __try_to_reclaim_swap(). __try_to_reclaim_swap()->folio_free_swap()->delete_from_swap_cache()-> put_swap_folio()->free_swap_slot()->swapcache_free_entries()-> swap_entry_free()->swap_range_free()-> ... WRITE_ONCE(si->inuse_pages, si->inuse_pages - nr_entries); What stops swapoff to succeed after process 2 reclaimed the swap cache but before process1 finished its call to swap_page_trans_huge_swapped()? --8<-----

HighCVSS 7Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

A race in Linux swap-memory handling could let one thread use memory after another disables swap and frees it. The source rates potential impact as high, including confidentiality, integrity, and availability, but triggering requires local access, elevated timing complexity, and specific concurrent activity. The Linux description calls the issue theoretical and reports no successful test reproduction.

Executive priority

Schedule remediation through normal high-severity kernel patching, with faster treatment for shared or untrusted multi-user Linux hosts. This is not presently an emergency exploitation event: available evidence describes a difficult, theoretical local race and does not establish exploitation. Avoid deferral solely because no reproducer exists, since the unsafe lifetime condition was accepted through code review.

Technical view

CVE-2024-26960 is a CWE-362 race between free_swap_and_cache() and swapoff(). swapoff() could destroy swap_info_struct while another thread accesses its freed swap_map through swap_page_trans_huge_swapped(), creating a possible use-after-free condition. The kernel fix holds a swap-device reference with get_swap_device()/put_swap_device() and adds an equivalent free-entry check.

Likely exposure

Exposure is limited to Linux systems running a listed affected kernel and exercising swap. The supplied record identifies versions including 4.11, 5.10.215, 5.15.154, 6.1.84, 6.6.24, 6.7.12, 6.8.3, and 6.9. Distribution backports may change actual status, so kernel version alone is insufficient.

Exploitation context

The CVSS vector is local, high-complexity, low-privilege, and requires no user interaction. Successful triggering appears to require precise concurrency between freeing swap-cache entries and swapoff. The record is not in KEV, provides no evidence of active exploitation, and states that the issue could not be reproduced in testing.

Researcher notes

The security consequence is described broadly rather than demonstrated; the supplied evidence does not establish a reliable trigger or specific post-race outcome. Exposure assessment should account for vendor backports and configuration. The seven stable-kernel commit references appear to represent fixes across maintained branches, but the bundle does not map each commit to a branch, so consult vendor metadata before declaring a system fixed.

Mitigation direction

  • Install a vendor-supported kernel containing the applicable stable fix or distribution backport.
  • Check Linux distribution or appliance-vendor advisories for the exact corrected package version.
  • Prioritize multi-user systems where untrusted local users can run processes and swap is enabled.
  • Use vendor-recommended mitigations if immediate kernel replacement is operationally impractical.

Validation and detection

  • Record the running kernel and installed kernel package versions on potentially exposed systems.
  • Confirm whether swap is configured or active, without treating disabled swap as proof of permanent remediation.
  • Compare package versions against vendor advisories and backport notices, not upstream version numbers alone.
  • Verify the applicable stable commit or equivalent patch is present in the deployed kernel source package.
  • After updating, reboot into the corrected kernel and confirm the running version.
Prepared
Confidence
high
Sources
11

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-362: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2024-26960 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

2CVSS vectors
3Timeline events
3ADP providers
10Source links

SSVC decision data

CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: partial

CVSS vector scores

2 official scores

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7CVSS 3.1HighCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H15.9Linux
5.5CVSS 3.1MediumCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H1.83.6CISA-ADP

Vulnerability scoring details

Base CVSS 3.1 score

7High
CVSS 3.1 vector shape for CVE-2024-26960Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. CVE publishedCVE Program

    The CVE record was published.

  3. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

ADP provider summaries

CISA-ADPCISA ADP Vulnrichment
cvssV3_1other:ssvc
CVECVE Program Container
siemens-SADPADP container
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
LinuxLinux7c00bafee87c7bac7ed9eced7c161f8e5332cb4e, 7c00bafee87c7bac7ed9eced7c161f8e5332cb4e, 7c00bafee87c7bac7ed9eced7c161f8e5332cb4e, 7c00bafee87c7bac7ed9eced7c161f8e5332cb4e, 7c00bafee87c7bac7ed9eced7c161f8e5332cb4e, 7c00bafee87c7bac7ed9eced7c161f8e5332cb4e, 7c00bafee87c7bac7ed9eced7c161f8e5332cb4eunaffected
LinuxLinux4.11, 0, 5.10.215, 5.15.154, 6.1.84, 6.6.24, 6.7.12, 6.8.3, 6.9affected
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-362 · source CWE mapping

Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.