HID: sensor: custom: Fix field sysfs group cleanup on failure
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 4a7de0519df5e8fb89cef6ee062330ffe4b50a4d · < f3f37b937a6ea2a00fb5e6189e74f855caa43eb5| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
HID: sensor: custom: Fix field sysfs group cleanup on failure
hid_sensor_custom_add_attributes() creates one sysfs group for each custom sensor field. If sysfs_create_group() fails after some groups have already been created, the function returns the error without removing the previously created groups.
Add a local unwind path to remove the groups that were already created. With enable_sensor exposed only after the field attributes are ready, this path can free sensor_inst->fields without leaving enable_sensor able to access pointers into that array.
From the CVE record · Linux
The Linux kernel’s HID custom sensor code can leave previously created sysfs groups behind if creating a later group fails. This can leave sensor field pointers accessible after the fields are freed. The input does not specify how an attacker could trigger the failure or whether access, authentication, or user interaction is required.
Engineers running Linux kernels with the HID custom sensor component should check their deployments; affected versions are not specified.