Skip to main content

CVE-2024-36478: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-36478cvecve-2024-36478
Published: Fri Jun 21 2024 (06/21/2024, 10:18:09 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: null_blk: fix null-ptr-dereference while configuring 'power' and 'submit_queues' Writing 'power' and 'submit_queues' concurrently will trigger kernel panic: Test script: modprobe null_blk nr_devices=0 mkdir -p /sys/kernel/config/nullb/nullb0 while true; do echo 1 > submit_queues; echo 4 > submit_queues; done & while true; do echo 1 > power; echo 0 > power; done Test result: BUG: kernel NULL pointer dereference, address: 0000000000000148 Oops: 0000 [#1] PREEMPT SMP RIP: 0010:__lock_acquire+0x41d/0x28f0 Call Trace: <TASK> lock_acquire+0x121/0x450 down_write+0x5f/0x1d0 simple_recursive_removal+0x12f/0x5c0 blk_mq_debugfs_unregister_hctxs+0x7c/0x100 blk_mq_update_nr_hw_queues+0x4a3/0x720 nullb_update_nr_hw_queues+0x71/0xf0 [null_blk] nullb_device_submit_queues_store+0x79/0xf0 [null_blk] configfs_write_iter+0x119/0x1e0 vfs_write+0x326/0x730 ksys_write+0x74/0x150 This is because del_gendisk() can concurrent with blk_mq_update_nr_hw_queues(): nullb_device_power_store nullb_apply_submit_queues null_del_dev del_gendisk nullb_update_nr_hw_queues if (!dev->nullb) // still set while gendisk is deleted return 0 blk_mq_update_nr_hw_queues dev->nullb = NULL Fix this problem by resuing the global mutex to protect nullb_device_power_store() and nullb_update_nr_hw_queues() from configfs.

AI-Powered Analysis

AILast updated: 06/29/2025, 09:40:37 UTC

Technical Analysis

CVE-2024-36478 is a vulnerability identified in the Linux kernel's null_blk module, which is a block device driver used primarily for testing and development purposes. The vulnerability arises from a race condition when concurrently writing to the 'power' and 'submit_queues' configuration parameters via configfs. Specifically, concurrent writes to these parameters can lead to a null pointer dereference in the kernel, causing a kernel panic and system crash. The root cause is a lack of proper synchronization between the functions nullb_device_power_store() and nullb_update_nr_hw_queues(), which manipulate shared data structures without adequate locking. This allows del_gendisk() to run concurrently with blk_mq_update_nr_hw_queues(), leading to a use-after-free or null pointer dereference scenario. The vulnerability is reproducible using a test script that rapidly alternates writes to 'submit_queues' and 'power', triggering the kernel panic. The fix involves reusing a global mutex to protect these critical sections, ensuring that concurrent modifications do not corrupt kernel state. This vulnerability affects specific Linux kernel versions identified by the commit hash 45919fbfe1c487c17ea1d198534339a5e8abeae3 and was published on June 21, 2024. There are no known exploits in the wild at this time, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, the impact of this vulnerability depends largely on the deployment of affected Linux kernel versions and the use of the null_blk module. While null_blk is primarily a testing and development driver, it is included in many Linux distributions and could be present in development, testing, or specialized environments. Exploitation leads to a kernel panic, causing denial of service (DoS) by crashing the system. This can disrupt critical services, especially in environments relying on Linux servers for infrastructure, cloud services, or embedded systems. Although this vulnerability does not directly lead to privilege escalation or data leakage, the resulting DoS can impact availability, potentially affecting business continuity, especially in sectors like finance, healthcare, and critical infrastructure. Since exploitation requires local access and specific interaction with configfs interfaces, remote exploitation is unlikely without prior access. However, insider threats or compromised accounts could trigger this vulnerability. The absence of known exploits reduces immediate risk, but organizations should prioritize patching to prevent future exploitation and maintain system stability.

Mitigation Recommendations

To mitigate this vulnerability, European organizations should: 1) Identify and inventory Linux systems running affected kernel versions, especially those used for development, testing, or specialized block device functions. 2) Apply the official Linux kernel patches that introduce the global mutex protecting nullb_device_power_store() and nullb_update_nr_hw_queues() as soon as they become available from trusted Linux distribution vendors or upstream kernel sources. 3) Restrict access to configfs interfaces, particularly the null_blk configuration directories, to trusted administrators only, minimizing the risk of unauthorized local exploitation. 4) Implement monitoring and alerting for unusual writes to configfs parameters related to null_blk, which could indicate attempts to trigger the vulnerability. 5) For environments where null_blk is not required, consider disabling or unloading the null_blk kernel module to eliminate the attack surface. 6) Incorporate this vulnerability into vulnerability management and patching workflows to ensure timely updates. 7) Conduct testing in staging environments before deploying patches to production to avoid unintended disruptions.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-06-21T10:13:16.284Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9828c4522896dcbe2552

Added to database: 5/21/2025, 9:08:56 AM

Last enriched: 6/29/2025, 9:40:37 AM

Last updated: 8/12/2025, 9:05:57 AM

Views: 14

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats