Skip to main content

CVE-2024-40978: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-40978cvecve-2024-40978
Published: Fri Jul 12 2024 (07/12/2024, 12:32:14 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: scsi: qedi: Fix crash while reading debugfs attribute The qedi_dbg_do_not_recover_cmd_read() function invokes sprintf() directly on a __user pointer, which results into the crash. To fix this issue, use a small local stack buffer for sprintf() and then call simple_read_from_buffer(), which in turns make the copy_to_user() call. BUG: unable to handle page fault for address: 00007f4801111000 PGD 8000000864df6067 P4D 8000000864df6067 PUD 864df7067 PMD 846028067 PTE 0 Oops: 0002 [#1] PREEMPT SMP PTI Hardware name: HPE ProLiant DL380 Gen10/ProLiant DL380 Gen10, BIOS U30 06/15/2023 RIP: 0010:memcpy_orig+0xcd/0x130 RSP: 0018:ffffb7a18c3ffc40 EFLAGS: 00010202 RAX: 00007f4801111000 RBX: 00007f4801111000 RCX: 000000000000000f RDX: 000000000000000f RSI: ffffffffc0bfd7a0 RDI: 00007f4801111000 RBP: ffffffffc0bfd7a0 R08: 725f746f6e5f6f64 R09: 3d7265766f636572 R10: ffffb7a18c3ffd08 R11: 0000000000000000 R12: 00007f4881110fff R13: 000000007fffffff R14: ffffb7a18c3ffca0 R15: ffffffffc0bfd7af FS: 00007f480118a740(0000) GS:ffff98e38af00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f4801111000 CR3: 0000000864b8e001 CR4: 00000000007706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: <TASK> ? __die_body+0x1a/0x60 ? page_fault_oops+0x183/0x510 ? exc_page_fault+0x69/0x150 ? asm_exc_page_fault+0x22/0x30 ? memcpy_orig+0xcd/0x130 vsnprintf+0x102/0x4c0 sprintf+0x51/0x80 qedi_dbg_do_not_recover_cmd_read+0x2f/0x50 [qedi 6bcfdeeecdea037da47069eca2ba717c84a77324] full_proxy_read+0x50/0x80 vfs_read+0xa5/0x2e0 ? folio_add_new_anon_rmap+0x44/0xa0 ? set_pte_at+0x15/0x30 ? do_pte_missing+0x426/0x7f0 ksys_read+0xa5/0xe0 do_syscall_64+0x58/0x80 ? __count_memcg_events+0x46/0x90 ? count_memcg_event_mm+0x3d/0x60 ? handle_mm_fault+0x196/0x2f0 ? do_user_addr_fault+0x267/0x890 ? exc_page_fault+0x69/0x150 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f4800f20b4d

AI-Powered Analysis

AILast updated: 06/29/2025, 02:57:17 UTC

Technical Analysis

CVE-2024-40978 is a vulnerability identified in the Linux kernel's SCSI qedi driver, specifically within the qedi_dbg_do_not_recover_cmd_read() function. The flaw arises because this function improperly invokes sprintf() directly on a __user pointer, which is a pointer to user-space memory. This misuse leads to a kernel crash due to a page fault when the kernel attempts to access user-space memory directly without proper validation or copying. The crash manifests as an 'Oops' error, indicating a kernel panic or fault, which can disrupt system stability. The root cause is the unsafe use of sprintf() on user-space pointers instead of first copying data into a safe kernel-space buffer. The fix involves using a small local stack buffer for sprintf() and then employing simple_read_from_buffer(), which safely copies data back to user space via copy_to_user(). This vulnerability affects Linux kernel versions identified by the commit hash 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 and is relevant to systems running the qedi driver, commonly found on hardware such as HPE ProLiant DL380 Gen10 servers. The vulnerability does not currently have known exploits in the wild and lacks an assigned CVSS score. The issue is primarily a denial-of-service (DoS) vector due to kernel crashes triggered by malformed debugfs reads, potentially impacting system availability and stability.

Potential Impact

For European organizations, the impact of CVE-2024-40978 centers on system availability and reliability, particularly for enterprises and data centers utilizing Linux servers with the qedi SCSI driver, such as those running on HPE ProLiant hardware. A successful exploitation can cause kernel crashes leading to system downtime, which may disrupt critical business operations, especially in sectors relying heavily on high-availability storage and server infrastructure like finance, telecommunications, healthcare, and government. While this vulnerability does not appear to allow privilege escalation or direct data compromise, repeated crashes could lead to service interruptions and potential data loss if systems are not properly backed up or if the crashes occur during critical I/O operations. The lack of known exploits reduces immediate risk, but the vulnerability's presence in widely used Linux kernels means that unpatched systems remain susceptible to accidental or malicious triggering of the crash. European organizations with stringent uptime requirements and those operating large-scale Linux-based storage environments are particularly at risk.

Mitigation Recommendations

To mitigate CVE-2024-40978, organizations should prioritize applying the official Linux kernel patches that correct the unsafe use of sprintf() in the qedi driver. Specifically, updating to kernel versions that include the fix or backporting the patch to existing supported kernels is essential. System administrators should audit their environments to identify servers running the qedi driver, especially on HPE ProLiant Gen10 hardware or similar platforms. Additionally, restricting access to debugfs interfaces to trusted users only can reduce the risk of accidental or malicious triggering of the vulnerability. Implementing kernel crash monitoring and alerting can help detect exploitation attempts early. For environments where immediate patching is not feasible, consider disabling or restricting the qedi debugfs attributes if possible. Regular backups and robust recovery procedures should be maintained to minimize impact from potential crashes. Finally, maintain vigilance for any emerging exploit reports or updates from Linux kernel security advisories.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-07-12T12:17:45.604Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9827c4522896dcbe1577

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

Last enriched: 6/29/2025, 2:57:17 AM

Last updated: 8/1/2025, 11:22:03 AM

Views: 16

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