Skip to main content

Linux Kernel CVE-2025-40054

HIGH
2025-10-28 416baaa9-dc9f-4396-8d5f-8c081fb06d67
7.8
CVSS 3.1 · Vendor: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain local write access to encrypted F2FS file
  2. Delivery
    Launch concurrent pwrite/fdatasync loops on same file
  3. Exploit
    Race writeback frees bounce page mid-use
  4. Execution
    Dangling fio->encrypted_page dereferenced in f2fs_is_cp_guaranteed
  5. Impact
    Kernel NULL/UAF panic (denial of service)

Vulnerability Assessment

Exploitation Conditions

Requires local access with the ability to write to a file on an F2FS filesystem that has fscrypt file-based encryption enabled (the bounce/encrypted page is the freed object), plus concurrent write and writeback activity on the same file to win the race in f2fs_merge_page_bio(). Limiting factors: the target mount must actually be F2FS with encryption in the in-place-update write path; the attacker needs a local low-privileged account (PR:L, no remote or network vector, AV:L); and success depends on precise timing between the writeback thread and a writing thread, so exploitation is a timing race rather than a deterministic single-shot trigger. No network exposure and no user interaction are involved.

Impact

This is a moderate, locally-scoped memory-safety bug rather than a remotely exploitable emergency. The CVSS 3.1 score of 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H) reflects local access with low privilege and no user interaction, but the C:H/I:H/A:H impact appears optimistic: the observed and reproducible outcome is a NULL-pointer dereference kernel panic (denial of service), consistent with the 'Denial Of Service' tag, and turning a UAF race into reliable code execution is non-trivial. The AC:L rating also understates difficulty - triggering the bug requires winning a tight timing race between concurrent writeback and write threads, so AC:H is more honest. Corroborating signals are consistent with lower urgency: EPSS is 0.19% (9th percentile), the CVE is not in CISA KEV, and there is no SSVC record provided. There is no public exploit, though the commit includes a two-shell race reproducer that reliably triggers the crash. Net: patch on normal kernel cadence; prioritize for multi-tenant or Android fleets using F2FS with encryption, where a local user inducing kernel panics is a realistic DoS concern.

Exploit ScenarioDerived

A local user on a device using F2FS with encryption runs two concurrent loops that repeatedly pwrite and fdatasync the same 32KB encrypted file, racing writeback against the write path so a bounce page is freed while still referenced. The result is a kernel NULL-pointer dereference and panic (denial of service); a working race reproducer is included in the fix commit, and a UAF could in principle be developed toward stronger impact given AV:L/PR:L local access.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 30, 2026

Use-after-free in the Linux kernel's F2FS (Flash-Friendly File System) encryption write path allows a local user to crash the kernel or corrupt memory during concurrent writes to encrypted files. The flaw lives in f2fs_merge_page_bio(), where a bounce/encrypted page can be freed by the write completion path (f2fs_write_end_io) while another thread still dereferences it via fio->encrypted_page in f2fs_is_cp_guaranteed(), producing a NULL/dangling pointer dereference. It is fixed upstream; no public weaponized exploit is identified, though the commit ships a race reproducer, and EPSS risk is low (0.19%).

RemediationAI

Upstream fix available (PR/commit); released patched version not independently confirmed - apply the stable-tree commits 01118321e0c8a5f3ece57d0d377bfc92d83cd210 and edf7e9040fc52c922db947f9c6c36f07377c52ea (https://git.kernel.org/stable/c/01118321e0c8a5f3ece57d0d377bfc92d83cd210 and https://git.kernel.org/stable/c/edf7e9040fc52c922db947f9c6c36f07377c52ea) or upgrade to a distribution/Android vendor kernel that has backported them. Since no tagged release version is stated in the input, verify the fix landed in your specific kernel branch before declaring closure. As a compensating control where patching lags, restrict local shell/write access to F2FS-encrypted mounts to trusted users (the bug requires local write access to an encrypted file), which reduces exposure but does not help single-user/consumer devices; where feasible and acceptable, avoiding in-place-update writes on encrypted F2FS files narrows the race window, at the cost of write-amplification and performance changes - treat this as a stopgap, not a substitute for the patch.

Affected ProductsAI

The Linux kernel's F2FS subsystem is affected on builds that use F2FS with fscrypt file-based encryption; the reproducer and crash were reported on a 6.12.30 Android kernel (bugzilla.kernel.org/show_bug.cgi?id=220575). No fixed tag version is stated in the input - the fix is delivered as stable-tree commits 01118321e0c8a5f3ece57d0d377bfc92d83cd210 and edf7e9040fc52c922db947f9c6c36f07377c52ea (git.kernel.org/stable). Exact vulnerable version ranges and the tagged release containing the fix are not provided by NVD CPE data here and should be confirmed against each distribution/Android vendor kernel.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

F2FS is a log-structured filesystem optimized for NAND flash and is the default filesystem for user data on many Android devices (the reported crash is on a 6.12.30 Android kernel). The bug is in the in-place-update (IPU) write path: f2fs_inplace_write_data() calls f2fs_merge_page_bio(), which caches an encrypted bounce page into an internal bio list (io->bio_list) via add_ipu_page. Transparent filesystem encryption (fscrypt) allocates a temporary bounce page for the ciphertext; when the bio is submitted and completes, f2fs_write_end_io() calls fscrypt_free_bounce_page() to release that page. Because the code continued to reference fio->encrypted_page after committing the page into the internal cache, a second thread could touch the already-freed page in f2fs_is_cp_guaranteed(). This is a classic CWE-416 (Use After Free) / CWE-476 (NULL pointer dereference) race, even though the input lists CWE as N/A. The fix stops using fio->encrypted_page after the page is committed to the IPU cache.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (416baaa9-dc9f-4396-8d5f-8c081fb06d67) PRIMARY 7.8 HIGH
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 5.8 MEDIUM

Local low-priv access with a tight write/writeback timing race (AV:L/PR:L/AC:H); observed impact is a UAF kernel panic (A:H) with limited, uncertain C/I from freed-memory access.

3.1 AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H
4.0 AV:L/AC:H/AT:N/PR:L/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N
SUSE 5.5 MEDIUM
AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Primary rating from Vendor (416baaa9-dc9f-4396-8d5f-8c081fb06d67).

CVSS VectorVendor: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

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

f2fs: fix UAF issue in f2fs_merge_page_bio()

As JY reported in bugzilla [1],

Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 pc : [0xffffffe51d249484] f2fs_is_cp_guaranteed+0x70/0x98 lr : [0xffffffe51d24adbc] f2fs_merge_page_bio+0x520/0x6d4 CPU: 3 UID: 0 PID: 6790 Comm: kworker/u16:3 Tainted: P B W OE 6.12.30-android16-5-maybe-dirty-4k #1 5f7701c9cbf727d1eebe77c89bbbeb3371e895e5 Tainted: [P]=PROPRIETARY_MODULE, [B]=BAD_PAGE, [W]=WARN, [O]=OOT_MODULE, [E]=UNSIGNED_MODULE Workqueue: writeback wb_workfn (flush-254:49) Call trace: f2fs_is_cp_guaranteed+0x70/0x98 f2fs_inplace_write_data+0x174/0x2f4 f2fs_do_write_data_page+0x214/0x81c f2fs_write_single_data_page+0x28c/0x764 f2fs_write_data_pages+0x78c/0xce4 do_writepages+0xe8/0x2fc __writeback_single_inode+0x4c/0x4b4 writeback_sb_inodes+0x314/0x540 __writeback_inodes_wb+0xa4/0xf4 wb_writeback+0x160/0x448 wb_workfn+0x2f0/0x5dc process_scheduled_works+0x1c8/0x458 worker_thread+0x334/0x3f0 kthread+0x118/0x1ac ret_from_fork+0x10/0x20

[1] https://bugzilla.kernel.org/show_bug.cgi?id=220575

The panic was caused by UAF issue w/ below race condition:

kworker

  • writepages
  • f2fs_write_cache_pages
  • f2fs_write_single_data_page
  • f2fs_do_write_data_page
  • f2fs_inplace_write_data
  • f2fs_merge_page_bio
  • add_inu_page

: cache page #1 into bio & cache bio in io->bio_list

  • f2fs_write_single_data_page
  • f2fs_do_write_data_page
  • f2fs_inplace_write_data
  • f2fs_merge_page_bio
  • add_inu_page

: cache page #2 into bio which is linked in io->bio_list write

  • f2fs_write_begin

: write page #1

  • f2fs_folio_wait_writeback
  • f2fs_submit_merged_ipu_write
  • f2fs_submit_write_bio

: submit bio which inclues page #1 and #2

software IRQ

  • f2fs_write_end_io
  • fscrypt_free_bounce_page

: freed bounced page which belongs to page #2

  • inc_page_count( , WB_DATA_TYPE(data_folio), false)

: data_folio points to fio->encrypted_page the bounced page can be freed before accessing it in f2fs_is_cp_guarantee()

It can reproduce w/ below testcase: Run below script in shell #1: for ((i=1;i>0;i++)) do xfs_io -f /mnt/f2fs/enc/file \ -c "pwrite 0 32k" -c "fdatasync"

Run below script in shell #2: for ((i=1;i>0;i++)) do xfs_io -f /mnt/f2fs/enc/file \ -c "pwrite 0 32k" -c "fdatasync"

So, in f2fs_merge_page_bio(), let's avoid using fio->encrypted_page after commit page into internal ipu cache.

Executive ViewAI

Why It Matters

CVE-2025-40054 affects Linux systems using F2FS (Flash-Friendly File System) encryption, allowing local users to trigger kernel crashes or memory corruption through race conditions during concurrent file writes. Organizations relying on F2FS-encrypted storage face availability and data integrity risks, particularly for systems with frequent concurrent writes to encrypted data.

Business Impact: High
Compensating Controls

Disable F2FS encryption where operationally feasible; restrict local user access via SELinux/AppArmor policies or container isolation; disable concurrent write operations on encrypted F2FS volumes if possible; establish monitoring for kernel crashes and memory corruption errors indicating exploitation attempts.

Threat Intelligence Overview

EPSS Score
0.2%
Top 91% exploitable
Prevalence
High
F2FS is the default user-data filesystem on many Android devices
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
High

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
openSUSE Tumbleweed Fixed
SUSE Linux Enterprise Desktop 15 SP7 Not-Affected
SUSE Linux Enterprise Desktop 15 SP7 Not-Affected
SUSE Linux Enterprise High Availability Extension 15 SP7 Not-Affected
SUSE Linux Enterprise High Availability Extension 15 SP7 Not-Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy