# CVE-2024-49880: ext4: fix off by one issue in alloc\_flex\_gd()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.32% (percentile 17, 2026-11-26)
- **CWE:** CWE-193
- **Published:** 2024-10-21T18:01:18.790Z
- **Modified:** 2026-06-17T08:00:38.810Z

## Who should check

- Anyone running Linux \>= 665d3e0af4d35acf9a5f58dfd471bc27dbf55880, \< 0d80d2b8bf613398baf7185009e35f9d0459ecb0; \>= 665d3e0af4d35acf9a5f58dfd471bc27dbf55880, \< acb559d6826116cc113598640d105094620c2526; \>= 665d3e0af4d35acf9a5f58dfd471bc27dbf55880, \< 6121258c2b33ceac3d21f6a221452692c465df88
- Anyone running Linux 6.8

## Description

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

ext4: fix off by one issue in alloc\_flex\_gd()

Wesley reported an issue:

==================================================================
EXT4-fs (dm-5): resizing filesystem from 7168 to 786432 blocks
------------\[ cut here \]------------
kernel BUG at fs/ext4/resize.c:324!
CPU: 9 UID: 0 PID: 3576 Comm: resize2fs Not tainted 6.11.0+ \#27
RIP: 0010:ext4\_resize\_fs+0x1212/0x12d0
Call Trace:
 \_\_ext4\_ioctl+0x4e0/0x1800
 ext4\_ioctl+0x12/0x20
 \_\_x64\_sys\_ioctl+0x99/0xd0
 x64\_sys\_call+0x1206/0x20d0
 do\_syscall\_64+0x72/0x110
 entry\_SYSCALL\_64\_after\_hwframe+0x76/0x7e
==================================================================

While reviewing the patch, Honza found that when adjusting resize\_bg in
alloc\_flex\_gd(), it was possible for flex\_gd-\>resize\_bg to be bigger than
flexbg\_size.

The reproduction of the problem requires the following:

 o\_group = flexbg\_size \* 2 \* n;
 o\_size = (o\_group + 1) \* group\_size;
 n\_group: \[o\_group + flexbg\_size, o\_group + flexbg\_size \* 2)
 o\_size = (n\_group + 1) \* group\_size;

Take n=0,flexbg\_size=16 as an example:

              last:15
\|o---------------\|--------------n-\|
o\_group:0    resize to      n\_group:30

The corresponding reproducer is:

img=test.img
rm -f $img
truncate -s 600M $img
mkfs.ext4 -F $img -b 1024 -G 16 8M
dev=\`losetup -f --show $img\`
mkdir -p /tmp/test
mount $dev /tmp/test
resize2fs $dev 248M

Delete the problematic plus 1 to fix the issue, and add a WARN\_ON\_ONCE()
to prevent the issue from happening again.

\[ Note: another reproucer which this commit fixes is:

  img=test.img
  rm -f $img
  truncate -s 25MiB $img
  mkfs.ext4 -b 4096 -E nodiscard,lazy\_itable\_init=0,lazy\_journal\_init=0 $img
  truncate -s 3GiB $img
  dev=\`losetup -f --show $img\`
  mkdir -p /tmp/test
  mount $dev /tmp/test
  resize2fs $dev 3G
  umount $dev
  losetup -d $dev

  -- TYT \]

## Affected and fixed versions

- Linux: \>= 665d3e0af4d35acf9a5f58dfd471bc27dbf55880, \< 0d80d2b8bf613398baf7185009e35f9d0459ecb0; \>= 665d3e0af4d35acf9a5f58dfd471bc27dbf55880, \< acb559d6826116cc113598640d105094620c2526; \>= 665d3e0af4d35acf9a5f58dfd471bc27dbf55880, \< 6121258c2b33ceac3d21f6a221452692c465df88 (cvelist)
- Linux: 6.8 (cvelist)

## Mitigation

- Upgrade Linux to 6121258c2b33ceac3d21f6a221452692c465df88 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-49880. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-49880.md
Affected: Linux >= 665d3e0af4d35acf9a5f58dfd471bc27dbf55880, < 0d80d2b8bf613398baf7185009e35f9d0459ecb0; >= 665d3e0af4d35acf9a5f58dfd471bc27dbf55880, < acb559d6826116cc113598640d105094620c2526; >= 665d3e0af4d35acf9a5f58dfd471bc27dbf55880, < 6121258c2b33ceac3d21f6a221452692c465df88; Linux 6.8
Fixed in: Linux 0d80d2b8bf613398baf7185009e35f9d0459ecb0, Linux 6121258c2b33ceac3d21f6a221452692c465df88

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-49880 being exploited?

There is no confirmed exploitation: CVE-2024-49880 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.32% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-49880?

High: CVSS 7.8 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-49880?

Linux \>= 665d3e0af4d35acf9a5f58dfd471bc27dbf55880, \< 0d80d2b8bf613398baf7185009e35f9d0459ecb0; \>= 665d3e0af4d35acf9a5f58dfd471bc27dbf55880, \< acb559d6826116cc113598640d105094620c2526; \>= 665d3e0af4d35acf9a5f58dfd471bc27dbf55880, \< 6121258c2b33ceac3d21f6a221452692c465df88; Linux 6.8.

### Is there a fix for CVE-2024-49880?

Yes. Fixed in Linux 0d80d2b8bf613398baf7185009e35f9d0459ecb0, Linux 6121258c2b33ceac3d21f6a221452692c465df88. Upgrade Linux to 6121258c2b33ceac3d21f6a221452692c465df88 or later.

### How do I check if I'm affected by CVE-2024-49880?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/0d80d2b8bf613398baf7185009e35f9d0459ecb0>
- patch: <https://git.kernel.org/stable/c/acb559d6826116cc113598640d105094620c2526>
- patch: <https://git.kernel.org/stable/c/6121258c2b33ceac3d21f6a221452692c465df88>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-49880>

HTML: <https://flawdb.com/CVE-2024-49880> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-49880>
