HID: intel-ish-hid: Fix use-after-free issue in ishtp_hid_remove()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 0b28cb4bcb17dcb5fe0763fc3e1a94398b8f6cf6 · < dea6a349bcaf243fff95dfd0428a26be6a0fb44e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
HID: intel-ish-hid: Fix use-after-free issue in ishtp_hid_remove()
The system can experience a random crash a few minutes after the driver is removed. This issue occurs due to improper handling of memory freeing in the ishtp_hid_remove() function.
The function currently frees the `driver_data` directly within the loop that destroys the HID devices, which can lead to accessing freed memory. Specifically, `hid_destroy_device()` uses `driver_data` when it calls `hid_ishtp_set_feature()` to power off the sensor, so freeing `driver_data` beforehand can result in accessing invalid memory.
This patch resolves the issue by storing the `driver_data` in a temporary variable before calling `hid_destroy_device()`, and then freeing the `driver_data` after the device is destroyed.
From the CVE record · Linux
The Linux kernel’s intel-ish-hid driver can access freed memory when removing a HID device. This can cause a crash after the driver is removed. The input does not describe an attacker, authentication requirement, or user interaction.
Engineers running the Linux kernel with the intel-ish-hid driver should check their kernel version; affected versions are not specified.