Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2024-40955

MEDIUM 5.5EPSS 16%

ext4: fix slab-out-of-bounds in ext4_mb_find_good_group_avg_frag_lists()

Mitigation

  • Upgrade Linux to 13df4d44a3aaabe61cd01d277b6ee23ead2a5206 or later.

Who should check

  • Anyone running Linux >= 7e170922f06bf46effa7c57f6035fc463d6edc7e, < 677ff4589f1501578fa903a25bb14831d0607992; >= 7e170922f06bf46effa7c57f6035fc463d6edc7e, < b829687ae1229224262bcabf49accfa2dbf8db06; >= 7e170922f06bf46effa7c57f6035fc463d6edc7e, < 13df4d44a3aaabe61cd01d277b6ee23ead2a5206
  • Anyone running Linux 6.5

Vulnerability facts

Affected
Linux >= 7e170922f06bf46effa7c57f6035fc463d6edc7e, < 677ff4589f1501578fa903a25bb14831d0607992; >= 7e170922f06bf46effa7c57f6035fc463d6edc7e, < b829687ae1229224262bcabf49accfa2dbf8db06; >= 7e170922f06bf46effa7c57f6035fc463d6edc7e, < 13df4d44a3aaabe61cd01d277b6ee23ead2a5206; Linux 6.5
Fixed in
Linux 677ff4589f1501578fa903a25bb14831d0607992, Linux 13df4d44a3aaabe61cd01d277b6ee23ead2a5206
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Not remotely exploitable (local or adjacent access needed)
CVSS
5.5 (v3.1, NVD)CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Local
  • Attack complexity: Low
  • Privileges required: Low
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: None
  • Integrity impact: None
  • Availability impact: High
EPSS
0.30% chance of exploitation in 30 days (percentile 16, 2026-11-26)
CWE
CWE-787
Published
Modified

Description

In the Linux kernel, the following vulnerability has been resolved: ext4: fix slab-out-of-bounds in ext4_mb_find_good_group_avg_frag_lists() We can trigger a slab-out-of-bounds with the following commands: mkfs.ext4 -F /dev/$disk 10G mount /dev/$disk /tmp/test echo 2147483647 > /sys/fs/ext4/$disk/mb_group_prealloc echo test > /tmp/test/file && sync ================================================================== BUG: KASAN: slab-out-of-bounds in ext4_mb_find_good_group_avg_frag_lists+0x8a/0x200 [ext4] Read of size 8 at addr ffff888121b9d0f0 by task kworker/u2:0/11 CPU: 0 PID: 11 Comm: kworker/u2:0 Tainted: GL 6.7.0-next-20240118 #521 Call Trace: dump_stack_lvl+0x2c/0x50 kasan_report+0xb6/0xf0 ext4_mb_find_good_group_avg_frag_lists+0x8a/0x200 [ext4] ext4_mb_regular_allocator+0x19e9/0x2370 [ext4] ext4_mb_new_blocks+0x88a/0x1370 [ext4] ext4_ext_map_blocks+0x14f7/0x2390 [ext4] ext4_map_blocks+0x569/0xea0 [ext4] ext4_do_writepages+0x10f6/0x1bc0 [ext4] [...] ================================================================== The flow of issue triggering is as follows: // Set s_mb_group_prealloc to 2147483647 via sysfs ext4_mb_new_blocks ext4_mb_normalize_request ext4_mb_normalize_group_request ac->ac_g_ex.fe_len = EXT4_SB(sb)->s_mb_group_prealloc ext4_mb_regular_allocator ext4_mb_choose_next_group ext4_mb_choose_next_group_best_avail mb_avg_fragment_size_order order = fls(len) - 2 = 29 ext4_mb_find_good_group_avg_frag_lists frag_list = &sbi->s_mb_avg_fragment_size[order] if (list_empty(frag_list)) // Trigger SOOB! At 4k block size, the length of the s_mb_avg_fragment_size list is 14, but an oversized s_mb_group_prealloc is set, causing slab-out-of-bounds to be triggered by an attempt to access an element at index 29. Add a new attr_id attr_clusters_in_group with values in the range [0, sbi->s_clusters_per_group] and declare mb_group_prealloc as that type to fix the issue. In addition avoid returning an order from mb_avg_fragment_size_order() greater than MB_NUM_ORDERS(sb) and reduce some useless loops.

Affected and fixed versions

Package / productAffectedFixedSource
Linux>= 7e170922f06bf46effa7c57f6035fc463d6edc7e, < 677ff4589f1501578fa903a25bb14831d0607992; >= 7e170922f06bf46effa7c57f6035fc463d6edc7e, < b829687ae1229224262bcabf49accfa2dbf8db06; >= 7e170922f06bf46effa7c57f6035fc463d6edc7e, < 13df4d44a3aaabe61cd01d277b6ee23ead2a5206—cvelist
Linux6.5—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

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

Details: https://flawdb.com/CVE-2024-40955.md
Affected: Linux >= 7e170922f06bf46effa7c57f6035fc463d6edc7e, < 677ff4589f1501578fa903a25bb14831d0607992; >= 7e170922f06bf46effa7c57f6035fc463d6edc7e, < b829687ae1229224262bcabf49accfa2dbf8db06; >= 7e170922f06bf46effa7c57f6035fc463d6edc7e, < 13df4d44a3aaabe61cd01d277b6ee23ead2a5206; Linux 6.5
Fixed in: Linux 677ff4589f1501578fa903a25bb14831d0607992, Linux 13df4d44a3aaabe61cd01d277b6ee23ead2a5206

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.

References

FAQ

Is CVE-2024-40955 being exploited?

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

How serious is CVE-2024-40955?

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

Which versions are affected by CVE-2024-40955?

Linux >= 7e170922f06bf46effa7c57f6035fc463d6edc7e, < 677ff4589f1501578fa903a25bb14831d0607992; >= 7e170922f06bf46effa7c57f6035fc463d6edc7e, < b829687ae1229224262bcabf49accfa2dbf8db06; >= 7e170922f06bf46effa7c57f6035fc463d6edc7e, < 13df4d44a3aaabe61cd01d277b6ee23ead2a5206; Linux 6.5.

Is there a fix for CVE-2024-40955?

Yes. Fixed in Linux 677ff4589f1501578fa903a25bb14831d0607992, Linux 13df4d44a3aaabe61cd01d277b6ee23ead2a5206. Upgrade Linux to 13df4d44a3aaabe61cd01d277b6ee23ead2a5206 or later.

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

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.

Sponsors