HIGH Introduced in 4.1
hid CustomSensor UAF
CVE-2026-89626
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
KernelScan AI6.8MEDIUM
01Description
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.
02KernelScan AI Analysis
Risk summary
A use-after-free in the HID custom sensor driver occurs when sysfs group creation fails partway through device probe. An attacker with physical access can plug in a malicious HID sensor device that triggers the failure path, leaving dangling sysfs entries that reference freed memory. Accessing those entries can lead to kernel memory corruption, privilege escalation, or a system crash.
Vulnerability analysis
When the driver registers sysfs attributes for each sensor field during device probe, a failure partway through leaves some attribute groups created while the underlying data is freed. Those leftover entries then point into freed memory, so any later access triggers a use-after-free. The fix adds cleanup that removes all already-created groups before freeing the field data, and only exposes the sensor control once all field attributes are successfully registered. The vulnerable code is reached when a HID sensor device is connected and its custom fields are enumerated, so an attacker needs physical access to plug in a crafted device — no special privileges are required beyond that physical access.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 4.1 | 5.10.270 | 416194933af6 |
| 5.15 | 4.1 | 5.15.221 | d0e15091e88d |
| 6.1 | 4.1 | 6.1.188 | 10b05fafff93 |
| 6.12 | 4.1 | 6.12.109 | 79154fad98ee |
| 6.18 | 4.1 | 6.18.50 | f3f37b937a6e |
| 6.6 | 4.1 | 6.6.157 | 2409779f3096 |
| 7.2 | 4.1 | 7.2.4 | d96f8958d446 |
| mainline | 4.1 | 7.3 | 3789d0802ddb |
| cip/5.10 | 4.1 | 5.10.271-cip78 | 416194933af6 |
| cip/5.10-rt | 4.1 | 5.10.272-cip79-rt35 | 416194933af6 |
| cip/6.1 | 4.1 | 6.1.189-cip61 | 10b05fafff93 |
| cip/6.1-rt | 4.1 | 6.1.189-cip61-rt32 | 10b05fafff93 |
| cip/6.12 | 4.1 | 6.12.111-cip32 | 79154fad98ee |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.111-cip32 |
| cip/6.1 | Fixed in 6.1.189-cip61 |
| cip/6.1-rt | Fixed in 6.1.189-cip61-rt32 |
| cip/5.10 | Fixed in 5.10.271-cip78 |
| cip/5.10-rt | Fixed in 5.10.272-cip79-rt35 |
| cip/4.19 | Affected — no CIP fix yet (latest 4.19.325-cip136) |
| cip/4.19-rt | Affected — no CIP fix yet (latest 4.19.325-cip136-rt50) |
| cip/4.4 | Affected — no CIP fix yet (latest 4.4.302-cip115) |
| cip/4.4-rt | Affected — no CIP fix yet (latest 4.4.302-cip115-rt63) |