Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2024-40998— ext4: fix uninitialized ratelimit_state->lock access in __ext4_fill_super()

Quick assessment

Affected
Linux Linux
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel 存在安全漏洞,该漏洞源于 ext4 文件系统在初始化时,未能正确初始化 ratelimit_state 的锁。

AI Predicted 5.5 Difficulty: Moderate EPSS 0.27% · P18

Possible ATT&CK Techniques 1 AI

T1059 · Command and Scripting Interpreter

Affected Version Matrix 8

VendorProduct Version RangeStatus
Linux Linux efbed4dc5857f845d787e406ce85097d1ccc5c4f< 23afcd52af06880c6c913a0ad99022b8937b575c affected
efbed4dc5857f845d787e406ce85097d1ccc5c4f< 645267906944a9aeec9d5c56ee24a9096a288798 affected
efbed4dc5857f845d787e406ce85097d1ccc5c4f< b4b4fda34e535756f9e774fb2d09c4537b7dfd1c affected
3.13 affected
< 3.13 unaffected
6.6.36≤ 6.6.* unaffected
6.9.7≤ 6.9.* unaffected
6.10≤ * unaffected
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2024-40998

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
ext4: fix uninitialized ratelimit_state->lock access in __ext4_fill_super()
Source: CVE Program / CVE List V5
Vulnerability 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.
Source: CVE Program / CVE List V5
CVSS Information
N/A
Source: CVE Program / CVE List V5
Vulnerability Type
N/A
Source: CVE Program / CVE List V5
Vulnerability Title
Linux kernel 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel 存在安全漏洞,该漏洞源于 ext4 文件系统在初始化时,未能正确初始化 ratelimit_state 的锁。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

Vendor Product Affected Versions CPE Subscribe
Linux Linux efbed4dc5857f845d787e406ce85097d1ccc5c4f ~ 23afcd52af06880c6c913a0ad99022b8937b575c -
Linux Linux 3.13 -

II. Public POCs for CVE-2024-40998

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2024-40998

请登录查看更多情报信息。

Other References for CVE-2024-40998 (3)

Same Patch Batch · Linux · 2024-07-12 · 122 CVEs total

CVE-2024-40907 9.8 CRITICAL ionic: fix kernel panic in XDP_TX action
CVE-2024-40923 9.8 CRITICAL vmxnet3: disable rx data ring on dma allocation failure
CVE-2024-40983 9.8 CRITICAL tipc: force a dst refcount before doing decryption
CVE-2024-40999 9.8 CRITICAL net: ena: Add validation for completion descriptors consistency
CVE-2024-40937 9.8 CRITICAL gve: Clear napi->skb before dev_kfree_skb_any()
CVE-2024-40910 8.8 HIGH ax25: Fix refcount imbalance on inbound connections
CVE-2024-40911 8.8 HIGH wifi: cfg80211: Lock wiphy in cfg80211_get_station
CVE-2024-40941 8.1 HIGH wifi: iwlwifi: mvm: don't read past the mfuart notifcation
CVE-2024-40953 7.9 HIGH KVM: Fix a data race on last_boosted_vcpu in kvm_vcpu_on_spin()
CVE-2024-39495 7.8 HIGH greybus: Fix use-after-free bug in gb_interface_release due to race condition.
CVE-2024-40943 7.8 HIGH ocfs2: fix races between hole punching and AIO+DIO
CVE-2024-40958 7.8 HIGH netns: Make get_net_ns() handle zero refcount net
CVE-2024-40956 7.8 HIGH dmaengine: idxd: Fix possible Use-After-Free in irq_process_work_list
CVE-2024-40991 7.8 HIGH dmaengine: ti: k3-udma-glue: Fix of_k3_udma_glue_parse_chn_by_id()
CVE-2024-40990 7.8 HIGH RDMA/mlx5: Add check for srq max_sge attribute
CVE-2024-40989 7.8 HIGH KVM: arm64: Disassociate vcpus from redistributor region on teardown
CVE-2024-40986 7.8 HIGH dmaengine: xilinx: xdma: Fix data synchronisation in xdma_channel_isr()
CVE-2024-40918 7.8 HIGH parisc: Try to fix random segmentation faults in package builds
CVE-2024-40947 7.8 HIGH ima: Avoid blocking in RCU read-side critical section
CVE-2024-40979 7.8 HIGH wifi: ath12k: fix kernel crash during resume

Showing top 20 of 122 CVEs. View all on vendor page &rarr; →

IV. Related Vulnerabilities

V. Comments for CVE-2024-40998

No comments yet


Leave a comment