CVE-2022-49380: f2fs: fix to avoid f2fs_bug_on() in dec_valid_node_count()

Published Feb 26, 2025
·
Updated

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

f2fs: fix to avoid f2fsbugon() in decvalidnodecount()

As Yanming reported in bugzilla:

https://bugzilla.kernel.org/showbug.cgi?id=215897

I have encountered a bug in F2FS file system in kernel v5.17.

The kernel should enable CONFIGKASAN=y and CONFIGKASANINLINE=y. You can reproduce the bug by running the following commands:

The kernel message is shown below:

kernel BUG at fs/f2fs/f2fs.h:2511! Call Trace: f2fsremoveinodepage+0x2a2/0x830 f2fsevictinode+0x9b7/0x1510 evict+0x282/0x4e0 dounlinkat+0x33a/0x540 x64sysunlinkat+0x8e/0xd0 dosyscall64+0x3b/0x90 entrySYSCALL64afterhwframe+0x44/0xae

The root cause is: .totalvalidblockcount or .totalvalidnodecount could fuzzed to zero, then once decvalidnodecount() was called, it will cause BUGON(), this patch fixes to print warning info and set SBINEEDFSCK into CP instead of panic.

Affected Software

6 affected components
Linux Kernel
Linux Linux kernel>=3.8<5.4.198
Linux Linux kernel>=5.5<5.10.121
Linux Linux kernel>=5.11<5.15.46
Linux Linux kernel>=5.16<5.17.14
Linux Linux kernel>=5.18<5.18.3

Event History

Feb 26, 2025
CVE Published
via MITRE·02:11 AM
Data Sourced
via MITRE·02:11 AM
Description
Data Sourced
via NVD·07:01 AM
RemedyDescriptionSeverityAffected Software

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