Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2025-40054— f2fs: fix UAF issue in f2fs_merge_page_bio()

Quick assessment

Affected
Linux Linux
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于f2fs_merge_page_bio函数中存在释放后重用问题,可能导致空指针取消引用。

CVSS 7.8 · High EPSS 0.17% · P6

Possible ATT&CK Techniques 1 AI

T1499 · Endpoint Denial of Service

Affected Version Matrix 16

VendorProduct Version RangeStatus
Linux Linux 0b20fcec8651569935a10afe03fedc0b812d044e< 1f7b44b4a2b2939f08b279cbb9e6b5dcb8ffea32 affected
0b20fcec8651569935a10afe03fedc0b812d044e< e193d8953647c8b575830852aa5ea0995b98d2b1 affected
0b20fcec8651569935a10afe03fedc0b812d044e< 410337c2301ae78a081e1b5ebbe8ec374fef4cb6 affected
0b20fcec8651569935a10afe03fedc0b812d044e< 68e094232dfe5027c4fd2dcded93d2d6800bae04 affected
0b20fcec8651569935a10afe03fedc0b812d044e< 7dd611131d82d7fc4212b555eb1103160bdad302 affected
0b20fcec8651569935a10afe03fedc0b812d044e< 01118321e0c8a5f3ece57d0d377bfc92d83cd210 affected
0b20fcec8651569935a10afe03fedc0b812d044e< edf7e9040fc52c922db947f9c6c36f07377c52ea affected
5.5 affected
… +8 more rows
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2025-40054

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
f2fs: fix UAF issue in f2fs_merge_page_bio()
Source: CVE Program / CVE List V5
Vulnerability Description
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.
Source: CVE Program / CVE List V5
CVSS Information
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Source: CVE Program / CVE List V5
Vulnerability Type
N/A
Source: CVE Program / CVE List V5
Vulnerability Title
Linux kernel 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于f2fs_merge_page_bio函数中存在释放后重用问题,可能导致空指针取消引用。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

Vendor Product Affected Versions CPE Subscribe
Linux Linux 0b20fcec8651569935a10afe03fedc0b812d044e ~ 1f7b44b4a2b2939f08b279cbb9e6b5dcb8ffea32 -
Linux Linux 5.5 -

II. Public POCs for CVE-2025-40054

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2025-40054

请登录查看更多情报信息。

Patches & Fixes for CVE-2025-40054 (4)

Same Patch Batch · Linux · 2025-10-28 · 58 CVEs total

CVE-2025-40074 9.8 CRITICAL ipv4: start using dst_dev_rcu()
CVE-2025-40058 8.8 HIGH iommu/vt-d: Disallow dirty tracking if incoherent page walk
CVE-2025-40039 8.8 HIGH ksmbd: Fix race condition in RPC handle list access
CVE-2025-40043 8.8 HIGH net: nfc: nci: Add parameter validation for packet data
CVE-2025-40046 8.6 HIGH io_uring/zcrx: fix overshooting recv limit
CVE-2025-40068 8.4 HIGH fs: ntfs3: Fix integer overflow in run_unpack()
CVE-2025-40075 8.1 HIGH tcp_metrics: use dst_dev_net_rcu()
CVE-2025-40026 7.9 HIGH KVM: x86: Don't (re)check L1 intercepts when completing userspace I/O
CVE-2025-40025 7.8 HIGH f2fs: fix to do sanity check on node footer for non inode dnode
CVE-2025-40044 7.8 HIGH fs: udf: fix OOB read in lengthAllocDescs handling
CVE-2025-40045 7.8 HIGH ASoC: codecs: wcd937x: set the comp soundwire port correctly
CVE-2025-40041 7.8 HIGH LoongArch: BPF: Sign-extend struct ops return values properly
CVE-2025-40051 7.8 HIGH vhost: vringh: Modify the return value check
CVE-2025-40047 7.8 HIGH io_uring/waitid: always prune wait queue entry in io_waitid_wait()
CVE-2025-40061 7.8 HIGH RDMA/rxe: Fix race in do_task() when draining
CVE-2025-40027 7.8 HIGH net/9p: fix double req put in p9_fd_cancelled
CVE-2025-40028 7.8 HIGH binder: fix double-free in dbitmap
CVE-2025-40081 7.8 HIGH perf: arm_spe: Prevent overflow in PERF_IDX2OFF()
CVE-2025-40079 7.8 HIGH riscv, bpf: Sign extend struct ops return values properly
CVE-2025-40067 7.8 HIGH fs/ntfs3: reject index allocation if $BITMAP is empty but blocks exist

Showing top 20 of 58 CVEs. View all on vendor page &rarr; →

IV. Related Vulnerabilities

V. Comments for CVE-2025-40054

No comments yet


Leave a comment