Skip to main content
EPSS 0.1%top 97%

Linux hwe edge: In the Linux kernel, the following vulnerability has been resolved: mm, swap: fix potential UAF issue for VMA readahead Since commit 78524b05f1a3… (CVE-2025-40270)

0
Medium
Published: 12/06/2025 (12/06/2025, 22:15:00 UTC)
Source: GCVE Database
Product: linux-hwe-edge

Description

In the Linux kernel, the following vulnerability has been resolved: mm, swap: fix potential UAF issue for VMA readahead Since commit 78524b05f1a3 ("mm, swap: avoid redundant swap device pinning"), the common helper for allocating and preparing a folio in the swap cache layer no longer tries to get a swap device reference internally, because all callers of __read_swap_cache_async are already holding a swap entry reference. The repeated swap device pinning isn't needed on the same swap device. Caller of VMA readahead is also holding a reference to the target entry's swap device, but VMA readahead walks the page table, so it might encounter swap entries from other devices, and call __read_swap_cache_async on another device without holding a reference to it. So it is possible to cause a UAF when swapoff of device A raced with swapin on device B, and VMA readahead tries to read swap entries from device A. It's not easy to trigger, but in theory, it could cause real issues. Make VMA readahead try to get the device reference first if the swap device is a different one from the target entry.

CVSS v3.1

Score 7.8high

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

Affected software

Affected versions
<6.17.0-1007.7~24.04.1<6.17.0-1008.8~24.04.1<6.17.0-1008.8<6.17.0-1011.11

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/30/2026, 17:23:50 UTC

Technical Analysis

The Linux kernel had a vulnerability in the memory management swap code where VMA readahead could cause a use-after-free (UAF) condition. This occurred because since commit 78524b05f1a3, the helper function __read_swap_cache_async stopped internally acquiring swap device references, assuming callers already held them. However, VMA readahead walks page tables and may encounter swap entries from multiple devices, calling __read_swap_cache_async on devices without holding references. This race condition between swapoff on one device and swapin on another could lead to UAF. The fix ensures VMA readahead obtains device references when accessing swap entries from devices different than the target entry's device.

Potential Impact

Successful exploitation could result in use-after-free conditions in kernel memory management, potentially leading to arbitrary code execution, kernel crashes, or data corruption. The CVSS vector indicates local attack vector with low complexity, requiring low privileges but no user interaction, and impacts confidentiality, integrity, and availability at a high level.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Since this is a Linux kernel vulnerability, monitor official Linux kernel repositories and vendor advisories for patches addressing CVE-2025-40270. Apply updates promptly once available to mitigate the risk. No specific temporary mitigations are indicated in the provided data.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-hfc9-3847-7v4r
Osv Schema Version
1.4.0
Aliases
["CVE-2025-40270"]
Database Specific Severity
HIGH
Cvss Version
3.1

Threat ID: 6a6b72d59c2644c7f847994a

Added to database: 07/30/2026, 15:50:45 UTC

Last enriched: 07/30/2026, 17:23:50 UTC

Last updated: 09/10/2026, 19:36:50 UTC

Views: 12

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses