CVE-2022-49707: ext4: add reserved GDT blocks check

Published Feb 26, 2025
·
Updated

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

ext4: add reserved GDT blocks check

We capture a NULL pointer issue when resizing a corrupt ext4 image which is freshly clear resizeinode feature (not run e2fsck). It could be simply reproduced by following steps. The problem is because of the resizeinode feature was cleared, and it will convert the filesystem to metabg mode in ext4resizefs(), but the es->sreservedgdtblocks was not reduced to zero, so could we mistakenly call reservebackupgdb() and passing an uninitialized resizeinode to it when adding new group descriptors.

mkfs.ext4 /dev/sda 3G tune2fs -O ^resizeinode /dev/sda #forget to run requested e2fsck mount /dev/sda /mnt resize2fs /dev/sda 8G

======== BUG: kernel NULL pointer dereference, address: 0000000000000028 CPU: 19 PID: 3243 Comm: resize2fs Not tainted 5.18.0-rc7-00001-gfde086c5ebfd #748 ... RIP: 0010:ext4flexgroupadd+0xe08/0x2570 ... Call Trace: <TASK> ext4resizefs+0xbec/0x1660 ext4ioctl+0x1749/0x24e0 ext4ioctl+0x12/0x20 x64sysioctl+0xa6/0x110 dosyscall64+0x3b/0x90 entrySYSCALL64afterhwframe+0x44/0xae RIP: 0033:0x7f2dd739617b ========

The fix is simple, add a check in ext4resizebegin() to make sure that the es->sreservedgdtblocks is zero when the resizeinode feature is disabled.

Affected Software

10 affected components
Linux Linux kernel
Linux Linux kernel<4.9.320
Linux Linux kernel>=4.10<4.14.285
Linux Linux kernel>=4.15<4.19.249
Linux Linux kernel>=4.20<5.4.200
Linux Linux kernel>=5.5<5.10.124
Linux Linux kernel>=5.11<5.15.49
Linux Linux kernel>=5.16<5.18.6
Linux Linux kernel=5.19-rc1
Linux Linux kernel=5.19-rc2

Event History

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

Frequently Asked Questions

1

What is the severity of CVE-2022-49707?

CVE-2022-49707 has been rated as a moderate severity vulnerability due to potential risk of NULL pointer dereference.

2

How do I fix CVE-2022-49707?

To fix CVE-2022-49707, ensure that your Linux kernel is updated to the latest version where the vulnerability has been resolved.

3

What software is affected by CVE-2022-49707?

CVE-2022-49707 affects versions of the Linux kernel that handle ext4 file systems.

4

What exploit does CVE-2022-49707 represent?

CVE-2022-49707 represents an exploit where resizing a corrupt ext4 image can lead to a system crash due to NULL pointer dereference.

5

Is there a workaround for CVE-2022-49707?

Currently, the best workaround for CVE-2022-49707 is to avoid resizing corrupt ext4 images until an update is applied.

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