CVE-2026-31715: f2fs: fix UAF caused by decrementing sbi->nr_pages[] in f2fs_write_end_io()

Published May 1, 2026
·
Updated

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

f2fs: fix UAF caused by decrementing sbi->nrpages[] in f2fswriteendio()

The xfstests case "generic/107" and syzbot have both reported a NULL pointer dereference.

The concurrent scenario that triggers the panic is as follows:

F2FSWBCPDATA write callback umount - f2fswritecheckpoint - f2fswaitonallpages(sbi, F2FSWBCPDATA) - blkmqendrequest - bioendio - f2fswriteendio : decpagecount(sbi, F2FSWBCPDATA) : wakeup(&sbi->cpwait) - killf2fssuper - killblocksuper - f2fsputsuper : iput(sbi->nodeinode) : sbi->nodeinode = NULL : f2fsinwarmnodelist - isnodefolio // sbi->nodeinode is NULL and panic

The root cause is that f2fsputsuper() calls iput(sbi->nodeinode) and sets sbi->nodeinode to NULL after sbi->nrpages[F2FSWBCPDATA] is decremented to zero. As a result, f2fsinwarmnodelist() may dereference a NULL nodeinode when checking whether a folio belongs to the node inode, leading to a panic.

This patch fixes the issue by calling f2fsinwarmnodelist() before decrementing sbi->nrpages[F2FSWBCPDATA], thus preventing the use-after-free condition.

Affected Software

4 affected components
Linux Linux kernel
Linux Linux kernel>=4.19<6.18.25
Linux Linux kernel>=6.19<7.0.2
Linux Linux kernel=7.1-rc1

Event History

May 1, 2026
CVE Published
via MITRE·01:56 PM
Data Sourced
via MITRE·01:56 PM
Description
Data Sourced
via NVD·02:16 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-31715?

CVE-2026-31715 is classified as a high-severity vulnerability due to the potential for a use-after-free condition.

2

How do I fix CVE-2026-31715?

To fix CVE-2026-31715, update your Linux kernel to versions above 6.18.25 or 6.19, or apply the relevant patches if available.

3

What systems are affected by CVE-2026-31715?

CVE-2026-31715 affects Linux kernel versions from 4.19 to 6.18.25, and 6.19 to 7.1-rc1.

4

What does CVE-2026-31715 exploit?

CVE-2026-31715 exploits a use-after-free vulnerability in the f2fs file system that can lead to undefined behavior.

5

Is CVE-2026-31715 publicly known?

Yes, CVE-2026-31715 is publicly known and has been reported through xfstests and syzbot.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203