HID: sensor: custom: Fix use-after-free in enable_sensor
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 4a7de0519df5e8fb89cef6ee062330ffe4b50a4d · < 8406d4b69d48bc72fb6f8812a65a17a1f903440b| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
HID: sensor: custom: Fix use-after-free in enable_sensor
enable_sensor_store() can call set_power_report_state(), which dereferences sensor_inst->power_state and sensor_inst->report_state. These pointers refer to entries in sensor_inst->fields.
Create the field attributes before exposing the enable_sensor sysfs attribute, so enable_sensor cannot be accessed before the state it depends on has been initialized.
On remove, delete enable_sensor before freeing the field attributes, so a concurrent sysfs write cannot dereference freed memory through power_state or report_state.
From the CVE record · Linux
The Linux kernel’s HID sensor custom code can dereference uninitialized or freed field attributes through the enable_sensor sysfs attribute. A user able to write that attribute may trigger a use-after-free during sensor removal; the input does not specify an authentication requirement.
Engineers running the Linux kernel should check whether their kernel includes the affected HID sensor custom code; affected versions are not specified.