CVE-2022-49879: ext4: fix BUG_ON() when directory entry has invalid rec_len

Published May 1, 2025
·
Updated

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

ext4: fix BUGON() when directory entry has invalid reclen

The reclen field in the directory entry has to be a multiple of 4. A corrupted filesystem image can be used to hit a BUG() in ext4reclentodisk(), called from makeindexeddir().

------------[ cut here ]------------ kernel BUG at fs/ext4/ext4.h:2413! ... RIP: 0010:makeindexeddir+0x53f/0x5f0 ... Call Trace: <TASK> ? adddirenttobuf+0x1b2/0x200 ext4addentry+0x36e/0x480 ext4addnondir+0x2b/0xc0 ext4create+0x163/0x200 pathopenat+0x635/0xe90 dofilpopen+0xb4/0x160 ? createobject.isra.0+0x1de/0x3b0 ? rawspinunlock+0x12/0x30 dosysopenat2+0x91/0x150 x64sysopen+0x6c/0xa0 dosyscall64+0x3c/0x80 entrySYSCALL64afterhwframe+0x46/0xb0

The fix simply adds a call to ext4checkdirentry() to validate the directory entry, returning -EFSCORRUPTED if the entry is invalid.

Affected Software

8 affected components
Linux Linux kernel
Linux Linux kernel<5.4.224
Linux Linux kernel>=5.5<5.10.154
Linux Linux kernel>=5.11<5.15.78
Linux Linux kernel>=5.16<6.0.8
Linux Linux kernel=6.1-rc1
Linux Linux kernel=6.1-rc2
Linux Linux kernel=6.1-rc3

Event History

May 1, 2025
CVE Published
via MITRE·02:10 PM
Data Sourced
via MITRE·02:10 PM
Description
Data Sourced
via NVD·03:16 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2022-49879?

CVE-2022-49879 is considered a critical vulnerability due to its potential to cause a system crash and corruption of filesystem data.

2

How do I fix CVE-2022-49879?

To fix CVE-2022-49879, upgrade to the latest version of the Linux kernel where the vulnerability has been patched.

3

What versions of the Linux kernel are affected by CVE-2022-49879?

CVE-2022-49879 affects multiple versions of the Linux kernel prior to the application's fix.

4

What does CVE-2022-49879 exploit in the Linux kernel?

CVE-2022-49879 exploits an issue in the ext4 filesystem where an invalid rec_len field can trigger a bug.

5

Can CVE-2022-49879 be exploited remotely?

CVE-2022-49879 requires a corrupted filesystem image, making it less likely to be exploited remotely without prior access.

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