cve-2024-56545
Vulnerability from cvelistv5
Published
2024-12-27 14:11
Modified
2025-01-20 06:22
Severity ?
Summary
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.
Impacted products
Vendor Product Version
Linux Linux Version: 62c68e7cee332e08e625af3bca3318814086490d
Version: 62c68e7cee332e08e625af3bca3318814086490d
Version: 62c68e7cee332e08e625af3bca3318814086490d
Version: 62c68e7cee332e08e625af3bca3318814086490d
Create a notification for this product.
   Linux Linux Version: 6.5
Create a notification for this product.
Show details on NVD website


{
   containers: {
      cna: {
         affected: [
            {
               defaultStatus: "unaffected",
               product: "Linux",
               programFiles: [
                  "drivers/hid/hid-hyperv.c",
               ],
               repo: "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               vendor: "Linux",
               versions: [
                  {
                     lessThan: "b03e713a400aeb5f969bab4daf47a7402d0df814",
                     status: "affected",
                     version: "62c68e7cee332e08e625af3bca3318814086490d",
                     versionType: "git",
                  },
                  {
                     lessThan: "19a9457e5e210e408c1f8865b5d93c5a2c90409d",
                     status: "affected",
                     version: "62c68e7cee332e08e625af3bca3318814086490d",
                     versionType: "git",
                  },
                  {
                     lessThan: "3d48d0fbaaa74a04fb9092780a3f83dc4f3f8160",
                     status: "affected",
                     version: "62c68e7cee332e08e625af3bca3318814086490d",
                     versionType: "git",
                  },
                  {
                     lessThan: "66ef47faa90d838cda131fe1f7776456cc3b59f2",
                     status: "affected",
                     version: "62c68e7cee332e08e625af3bca3318814086490d",
                     versionType: "git",
                  },
               ],
            },
            {
               defaultStatus: "affected",
               product: "Linux",
               programFiles: [
                  "drivers/hid/hid-hyperv.c",
               ],
               repo: "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
               vendor: "Linux",
               versions: [
                  {
                     status: "affected",
                     version: "6.5",
                  },
                  {
                     lessThan: "6.5",
                     status: "unaffected",
                     version: "0",
                     versionType: "semver",
                  },
                  {
                     lessThanOrEqual: "6.6.*",
                     status: "unaffected",
                     version: "6.6.64",
                     versionType: "semver",
                  },
                  {
                     lessThanOrEqual: "6.11.*",
                     status: "unaffected",
                     version: "6.11.11",
                     versionType: "semver",
                  },
                  {
                     lessThanOrEqual: "6.12.*",
                     status: "unaffected",
                     version: "6.12.2",
                     versionType: "semver",
                  },
                  {
                     lessThanOrEqual: "*",
                     status: "unaffected",
                     version: "6.13",
                     versionType: "original_commit_for_fix",
                  },
               ],
            },
         ],
         descriptions: [
            {
               lang: "en",
               value: "In the Linux kernel, the following vulnerability has been resolved:\n\nHID: hyperv: streamline driver probe to avoid devres issues\n\nIt was found that unloading 'hid_hyperv' module results in a devres\ncomplaint:\n\n ...\n hv_vmbus: unregistering driver hid_hyperv\n ------------[ cut here ]------------\n WARNING: CPU: 2 PID: 3983 at drivers/base/devres.c:691 devres_release_group+0x1f2/0x2c0\n ...\n Call Trace:\n  <TASK>\n  ? devres_release_group+0x1f2/0x2c0\n  ? __warn+0xd1/0x1c0\n  ? devres_release_group+0x1f2/0x2c0\n  ? report_bug+0x32a/0x3c0\n  ? handle_bug+0x53/0xa0\n  ? exc_invalid_op+0x18/0x50\n  ? asm_exc_invalid_op+0x1a/0x20\n  ? devres_release_group+0x1f2/0x2c0\n  ? devres_release_group+0x90/0x2c0\n  ? rcu_is_watching+0x15/0xb0\n  ? __pfx_devres_release_group+0x10/0x10\n  hid_device_remove+0xf5/0x220\n  device_release_driver_internal+0x371/0x540\n  ? klist_put+0xf3/0x170\n  bus_remove_device+0x1f1/0x3f0\n  device_del+0x33f/0x8c0\n  ? __pfx_device_del+0x10/0x10\n  ? cleanup_srcu_struct+0x337/0x500\n  hid_destroy_device+0xc8/0x130\n  mousevsc_remove+0xd2/0x1d0 [hid_hyperv]\n  device_release_driver_internal+0x371/0x540\n  driver_detach+0xc5/0x180\n  bus_remove_driver+0x11e/0x2a0\n  ? __mutex_unlock_slowpath+0x160/0x5e0\n  vmbus_driver_unregister+0x62/0x2b0 [hv_vmbus]\n  ...\n\nAnd the issue seems to be that the corresponding devres group is not\nallocated. Normally, devres_open_group() is called from\n__hid_device_probe() but Hyper-V HID driver overrides 'hid_dev->driver'\nwith 'mousevsc_hid_driver' stub and basically re-implements\n__hid_device_probe() by calling hid_parse() and hid_hw_start() but not\ndevres_open_group(). hid_device_probe() does not call __hid_device_probe()\nfor it. Later, when the driver is removed, hid_device_remove() calls\ndevres_release_group() as it doesn't check whether hdev->driver was\ninitially overridden or not.\n\nThe issue seems to be related to the commit 62c68e7cee33 (\"HID: ensure\ntimely release of driver-allocated resources\") but the commit itself seems\nto be correct.\n\nFix the issue by dropping the 'hid_dev->driver' override and using\nhid_register_driver()/hid_unregister_driver() instead. Alternatively, it\nwould have been possible to rely on the default handling but\nHID_CONNECT_DEFAULT implies HID_CONNECT_HIDRAW and it doesn't seem to work\nfor mousevsc as-is.",
            },
         ],
         providerMetadata: {
            dateUpdated: "2025-01-20T06:22:37.759Z",
            orgId: "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            shortName: "Linux",
         },
         references: [
            {
               url: "https://git.kernel.org/stable/c/b03e713a400aeb5f969bab4daf47a7402d0df814",
            },
            {
               url: "https://git.kernel.org/stable/c/19a9457e5e210e408c1f8865b5d93c5a2c90409d",
            },
            {
               url: "https://git.kernel.org/stable/c/3d48d0fbaaa74a04fb9092780a3f83dc4f3f8160",
            },
            {
               url: "https://git.kernel.org/stable/c/66ef47faa90d838cda131fe1f7776456cc3b59f2",
            },
         ],
         title: "HID: hyperv: streamline driver probe to avoid devres issues",
         x_generator: {
            engine: "bippy-5f407fcff5a0",
         },
      },
   },
   cveMetadata: {
      assignerOrgId: "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      assignerShortName: "Linux",
      cveId: "CVE-2024-56545",
      datePublished: "2024-12-27T14:11:26.722Z",
      dateReserved: "2024-12-27T14:03:05.989Z",
      dateUpdated: "2025-01-20T06:22:37.759Z",
      state: "PUBLISHED",
   },
   dataType: "CVE_RECORD",
   dataVersion: "5.1",
   "vulnerability-lookup:meta": {
      nvd: "{\"cve\":{\"id\":\"CVE-2024-56545\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-12-27T14:15:34.270\",\"lastModified\":\"2024-12-27T14:15:34.270\",\"vulnStatus\":\"Received\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nHID: hyperv: streamline driver probe to avoid devres issues\\n\\nIt was found that unloading 'hid_hyperv' module results in a devres\\ncomplaint:\\n\\n ...\\n hv_vmbus: unregistering driver hid_hyperv\\n ------------[ cut here ]------------\\n WARNING: CPU: 2 PID: 3983 at drivers/base/devres.c:691 devres_release_group+0x1f2/0x2c0\\n ...\\n Call Trace:\\n  <TASK>\\n  ? devres_release_group+0x1f2/0x2c0\\n  ? __warn+0xd1/0x1c0\\n  ? devres_release_group+0x1f2/0x2c0\\n  ? report_bug+0x32a/0x3c0\\n  ? handle_bug+0x53/0xa0\\n  ? exc_invalid_op+0x18/0x50\\n  ? asm_exc_invalid_op+0x1a/0x20\\n  ? devres_release_group+0x1f2/0x2c0\\n  ? devres_release_group+0x90/0x2c0\\n  ? rcu_is_watching+0x15/0xb0\\n  ? __pfx_devres_release_group+0x10/0x10\\n  hid_device_remove+0xf5/0x220\\n  device_release_driver_internal+0x371/0x540\\n  ? klist_put+0xf3/0x170\\n  bus_remove_device+0x1f1/0x3f0\\n  device_del+0x33f/0x8c0\\n  ? __pfx_device_del+0x10/0x10\\n  ? cleanup_srcu_struct+0x337/0x500\\n  hid_destroy_device+0xc8/0x130\\n  mousevsc_remove+0xd2/0x1d0 [hid_hyperv]\\n  device_release_driver_internal+0x371/0x540\\n  driver_detach+0xc5/0x180\\n  bus_remove_driver+0x11e/0x2a0\\n  ? __mutex_unlock_slowpath+0x160/0x5e0\\n  vmbus_driver_unregister+0x62/0x2b0 [hv_vmbus]\\n  ...\\n\\nAnd the issue seems to be that the corresponding devres group is not\\nallocated. Normally, devres_open_group() is called from\\n__hid_device_probe() but Hyper-V HID driver overrides 'hid_dev->driver'\\nwith 'mousevsc_hid_driver' stub and basically re-implements\\n__hid_device_probe() by calling hid_parse() and hid_hw_start() but not\\ndevres_open_group(). hid_device_probe() does not call __hid_device_probe()\\nfor it. Later, when the driver is removed, hid_device_remove() calls\\ndevres_release_group() as it doesn't check whether hdev->driver was\\ninitially overridden or not.\\n\\nThe issue seems to be related to the commit 62c68e7cee33 (\\\"HID: ensure\\ntimely release of driver-allocated resources\\\") but the commit itself seems\\nto be correct.\\n\\nFix the issue by dropping the 'hid_dev->driver' override and using\\nhid_register_driver()/hid_unregister_driver() instead. Alternatively, it\\nwould have been possible to rely on the default handling but\\nHID_CONNECT_DEFAULT implies HID_CONNECT_HIDRAW and it doesn't seem to work\\nfor mousevsc as-is.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/19a9457e5e210e408c1f8865b5d93c5a2c90409d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/3d48d0fbaaa74a04fb9092780a3f83dc4f3f8160\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/66ef47faa90d838cda131fe1f7776456cc3b59f2\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/b03e713a400aeb5f969bab4daf47a7402d0df814\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}",
   },
}


Log in or create an account to share your comment.

Security Advisory comment format.

This schema specifies the format of a comment related to a security advisory.

UUIDv4 of the comment
UUIDv4 of the Vulnerability-Lookup instance
When the comment was created originally
When the comment was last updated
Title of the comment
Description of the comment
The identifier of the vulnerability (CVE ID, GHSA-ID, PYSEC ID, etc.).



Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.