CVE-2024-56545 Information
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:
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.
Reference
https://git.kernel.org/stable/c/19a9457e5e210e408c1f8865b5d93c5a2c90409d https://git.kernel.org/stable/c/3d48d0fbaaa74a04fb9092780a3f83dc4f3f8160 https://git.kernel.org/stable/c/66ef47faa90d838cda131fe1f7776456cc3b59f2 https://git.kernel.org/stable/c/b03e713a400aeb5f969bab4daf47a7402d0df814
Share on: