CVE-2024-40998
ext4: fix uninitialized ratelimit_state->lock access in __ext4_fill_super()
Mitigation
- No fix listed yet: follow the vendor advisory.
Who should check
- Anyone running Linux >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < 1e2df0ee0afd6d4b436a740f04f7a759e6531005; >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < 23afcd52af06880c6c913a0ad99022b8937b575c; >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < 645267906944a9aeec9d5c56ee24a9096a288798; >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < b4b4fda34e535756f9e774fb2d09c4537b7dfd1c
- Anyone running Linux 3.13
Vulnerability facts
- Affected
- Linux >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < 1e2df0ee0afd6d4b436a740f04f7a759e6531005; >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < 23afcd52af06880c6c913a0ad99022b8937b575c; >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < 645267906944a9aeec9d5c56ee24a9096a288798; >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < b4b4fda34e535756f9e774fb2d09c4537b7dfd1c; Linux 3.13
- Fixed in
- Linux 1e2df0ee0afd6d4b436a740f04f7a759e6531005, Linux 23afcd52af06880c6c913a0ad99022b8937b575c, Linux 645267906944a9aeec9d5c56ee24a9096a288798
- 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-908
- Modified
Description
In the Linux kernel, the following vulnerability has been resolved: ext4: fix uninitialized ratelimit_state->lock access in __ext4_fill_super() In the following concurrency we will access the uninitialized rs->lock: ext4_fill_super ext4_register_sysfs // sysfs registered msg_ratelimit_interval_ms // Other processes modify rs->interval to // non-zero via msg_ratelimit_interval_ms ext4_orphan_cleanup ext4_msg(sb, KERN_INFO, "Errors on filesystem, " __ext4_msg ___ratelimit(&(EXT4_SB(sb)->s_msg_ratelimit_state) if (!rs->interval) // do nothing if interval is 0 return 1; raw_spin_trylock_irqsave(&rs->lock, flags) raw_spin_trylock(lock) _raw_spin_trylock __raw_spin_trylock spin_acquire(&lock->dep_map, 0, 1, _RET_IP_) lock_acquire __lock_acquire register_lock_class assign_lock_key dump_stack(); ratelimit_state_init(&sbi->s_msg_ratelimit_state, 5 * HZ, 10); raw_spin_lock_init(&rs->lock); // init rs->lock here and get the following dump_stack: ========================================================= INFO: trying to register non-static key. The code is fine but needs lockdep annotation, or maybe you didn't initialize this object before use? turning off the locking correctness validator. CPU: 12 PID: 753 Comm: mount Tainted: G E 6.7.0-rc6-next-20231222 #504 [...] Call Trace: dump_stack_lvl+0xc5/0x170 dump_stack+0x18/0x30 register_lock_class+0x740/0x7c0 __lock_acquire+0x69/0x13a0 lock_acquire+0x120/0x450 _raw_spin_trylock+0x98/0xd0 ___ratelimit+0xf6/0x220 __ext4_msg+0x7f/0x160 [ext4] ext4_orphan_cleanup+0x665/0x740 [ext4] __ext4_fill_super+0x21ea/0x2b10 [ext4] ext4_fill_super+0x14d/0x360 [ext4] [...] ========================================================= Normally interval is 0 until s_msg_ratelimit_state is initialized, so ___ratelimit() does nothing. But registering sysfs precedes initializing rs->lock, so it is possible to change rs->interval to a non-zero value via the msg_ratelimit_interval_ms interface of sysfs while rs->lock is uninitialized, and then a call to ext4_msg triggers the problem by accessing an uninitialized rs->lock. Therefore register sysfs after all initializations are complete to avoid such problems.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Linux | >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < 1e2df0ee0afd6d4b436a740f04f7a759e6531005; >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < 23afcd52af06880c6c913a0ad99022b8937b575c; >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < 645267906944a9aeec9d5c56ee24a9096a288798; >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < b4b4fda34e535756f9e774fb2d09c4537b7dfd1c | — | cvelist |
| Linux | 3.13 | — | 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-40998. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2024-40998.md Affected: Linux >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < 1e2df0ee0afd6d4b436a740f04f7a759e6531005; >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < 23afcd52af06880c6c913a0ad99022b8937b575c; >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < 645267906944a9aeec9d5c56ee24a9096a288798; >= efbed4dc5857f845d787e40… Fixed in: Linux 1e2df0ee0afd6d4b436a740f04f7a759e6531005, Linux 23afcd52af06880c6c913a0ad99022b8937b575c, Linux 645267906944a9aeec9d5c56ee24a9096a288798 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
Patches
FAQ
Is CVE-2024-40998 being exploited?
There is no confirmed exploitation: CVE-2024-40998 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-40998?
Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).
Which versions are affected by CVE-2024-40998?
Linux >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < 1e2df0ee0afd6d4b436a740f04f7a759e6531005; >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < 23afcd52af06880c6c913a0ad99022b8937b575c; >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < 645267906944a9aeec9d5c56ee24a9096a288798; >= efbed4dc5857f845d787e406ce85097d1ccc5c4f, < b4b4fda34e535756f9e774fb2d09c4537b7dfd1c; Linux 3.13.
Is there a fix for CVE-2024-40998?
Yes. Fixed in Linux 1e2df0ee0afd6d4b436a740f04f7a759e6531005, Linux 23afcd52af06880c6c913a0ad99022b8937b575c, Linux 645267906944a9aeec9d5c56ee24a9096a288798. No fix listed yet: follow the vendor advisory.
How do I check if I'm affected by CVE-2024-40998?
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.