Skip to main content

CVE-2024-56545: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-56545cvecve-2024-56545
Published: Fri Dec 27 2024 (12/27/2024, 14:11:26 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: HID: hyperv: streamline driver probe to avoid devres issues It was found that unloading 'hid_hyperv' module results in a devres complaint: ... hv_vmbus: unregistering driver hid_hyperv ------------[ cut here ]------------ WARNING: CPU: 2 PID: 3983 at drivers/base/devres.c:691 devres_release_group+0x1f2/0x2c0 ... Call Trace: <TASK> ? devres_release_group+0x1f2/0x2c0 ? __warn+0xd1/0x1c0 ? devres_release_group+0x1f2/0x2c0 ? report_bug+0x32a/0x3c0 ? handle_bug+0x53/0xa0 ? exc_invalid_op+0x18/0x50 ? asm_exc_invalid_op+0x1a/0x20 ? devres_release_group+0x1f2/0x2c0 ? devres_release_group+0x90/0x2c0 ? rcu_is_watching+0x15/0xb0 ? __pfx_devres_release_group+0x10/0x10 hid_device_remove+0xf5/0x220 device_release_driver_internal+0x371/0x540 ? klist_put+0xf3/0x170 bus_remove_device+0x1f1/0x3f0 device_del+0x33f/0x8c0 ? __pfx_device_del+0x10/0x10 ? cleanup_srcu_struct+0x337/0x500 hid_destroy_device+0xc8/0x130 mousevsc_remove+0xd2/0x1d0 [hid_hyperv] device_release_driver_internal+0x371/0x540 driver_detach+0xc5/0x180 bus_remove_driver+0x11e/0x2a0 ? __mutex_unlock_slowpath+0x160/0x5e0 vmbus_driver_unregister+0x62/0x2b0 [hv_vmbus] ... And the issue seems to be that the corresponding devres group is not allocated. Normally, devres_open_group() is called from __hid_device_probe() but Hyper-V HID driver overrides 'hid_dev->driver' with 'mousevsc_hid_driver' stub and basically re-implements __hid_device_probe() by calling hid_parse() and hid_hw_start() but not devres_open_group(). hid_device_probe() does not call __hid_device_probe() for it. Later, when the driver is removed, hid_device_remove() calls devres_release_group() as it doesn't check whether hdev->driver was initially overridden or not. The issue seems to be related to the commit 62c68e7cee33 ("HID: ensure timely release of driver-allocated resources") but the commit itself seems to be correct. Fix the issue by dropping the 'hid_dev->driver' override and using hid_register_driver()/hid_unregister_driver() instead. Alternatively, it would have been possible to rely on the default handling but HID_CONNECT_DEFAULT implies HID_CONNECT_HIDRAW and it doesn't seem to work for mousevsc as-is.

AI-Powered Analysis

AILast updated: 06/28/2025, 11:40:29 UTC

Technical Analysis

CVE-2024-56545 is a vulnerability identified in the Linux kernel specifically related to the handling of the 'hid_hyperv' module, which is a Hyper-V HID (Human Interface Device) driver. The issue arises during the unloading process of this module, where a devres (device resource management) complaint is triggered. The root cause is that the devres group, which is responsible for managing driver-allocated resources, is not properly allocated due to the way the 'hid_hyperv' driver overrides the 'hid_dev->driver' pointer with a stub driver ('mousevsc_hid_driver'). This override bypasses the normal call to devres_open_group() that typically occurs in the __hid_device_probe() function. Instead, the driver reimplements probing by calling hid_parse() and hid_hw_start() directly, without opening a devres group. Later, when the driver is removed, hid_device_remove() calls devres_release_group() unconditionally, expecting a devres group to exist, which leads to a warning and potential instability or kernel errors. The problem is linked to a previous commit (62c68e7cee33) intended to ensure timely release of driver-allocated resources, but the new driver implementation conflicts with this mechanism. The fix involves dropping the override of 'hid_dev->driver' and instead using the standard hid_register_driver() and hid_unregister_driver() functions to properly manage resources and driver lifecycle. This ensures that devres groups are correctly allocated and released, preventing the warning and potential kernel issues during module unload. The vulnerability does not appear to have known exploits in the wild and affects specific Linux kernel versions containing the problematic commit. It is a resource management and driver lifecycle bug that could lead to kernel warnings and potentially unstable behavior during device removal or module unload in Hyper-V environments running Linux kernels with this driver implementation flaw.

Potential Impact

For European organizations, the impact of CVE-2024-56545 is primarily related to system stability and reliability rather than direct compromise of confidentiality or integrity. Organizations running Linux on Hyper-V virtualized environments—common in data centers and cloud infrastructures—may experience kernel warnings or errors when the 'hid_hyperv' module is unloaded. This could lead to unexpected device removal failures, degraded system performance, or in rare cases, kernel panics if the resource management issues cascade. While no direct remote code execution or privilege escalation is indicated, the instability could disrupt critical services, especially in environments relying on dynamic device management or frequent module reloads. This is particularly relevant for European enterprises and public sector organizations using Microsoft Azure or private Hyper-V virtualization with Linux guests. The vulnerability could affect operational continuity and increase maintenance overhead due to the need for kernel debugging or forced reboots. However, the absence of known exploits and the technical nature of the bug suggest the risk is moderate and mostly affects system administrators and kernel developers rather than end users directly.

Mitigation Recommendations

To mitigate CVE-2024-56545, European organizations should: 1) Apply the latest Linux kernel updates that include the fix removing the 'hid_dev->driver' override and properly registering the HID driver using hid_register_driver()/hid_unregister_driver(). This ensures correct devres group management and prevents the warning during module unload. 2) For environments where immediate patching is not feasible, avoid unloading the 'hid_hyperv' module dynamically or schedule maintenance windows to minimize impact. 3) Monitor kernel logs for devres warnings related to 'hid_hyperv' or 'mousevsc' drivers to detect potential issues early. 4) Test kernel updates in staging environments, especially in Hyper-V virtualized Linux guests, to verify stability before production deployment. 5) Collaborate with Linux distribution vendors or cloud providers to ensure timely deployment of patched kernels. 6) Consider implementing kernel live patching solutions if supported, to reduce downtime when applying fixes. These steps go beyond generic advice by focusing on the specific driver and module lifecycle management issues highlighted by the vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-12-27T14:03:05.989Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9823c4522896dcbdf1c8

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

Last enriched: 6/28/2025, 11:40:29 AM

Last updated: 8/15/2025, 10:44:00 AM

Views: 13

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