KernelScan.io

HIGH Introduced in 4.1

hid CustomSensor UAF

CVE-2026-89626

CVSS 8.8 / 10.0 NVD

CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

KernelScan AI6.8MEDIUM

01

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.

02

Engine v0.6.0

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.

Affecteddrivers/hid/hid-sensor-custom.c (HID sensor custom)

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.

03

BranchIntroducedFixed inPatch commit
5.104.15.10.270416194933af6
5.154.15.15.221d0e15091e88d
6.14.16.1.18810b05fafff93
6.124.16.12.10979154fad98ee
6.184.16.18.50f3f37b937a6e
6.64.16.6.1572409779f3096
7.24.17.2.4d96f8958d446
mainline4.17.33789d0802ddb
cip/5.104.15.10.271-cip78416194933af6
cip/5.10-rt4.15.10.272-cip79-rt35416194933af6
cip/6.14.16.1.189-cip6110b05fafff93
cip/6.1-rt4.16.1.189-cip61-rt3210b05fafff93
cip/6.124.16.12.111-cip3279154fad98ee

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.111-cip32
cip/6.1Fixed in 6.1.189-cip61
cip/6.1-rtFixed in 6.1.189-cip61-rt32
cip/5.10Fixed in 5.10.271-cip78
cip/5.10-rtFixed in 5.10.272-cip79-rt35
cip/4.19Affected — no CIP fix yet (latest 4.19.325-cip136)
cip/4.19-rtAffected — no CIP fix yet (latest 4.19.325-cip136-rt50)
cip/4.4Affected — no CIP fix yet (latest 4.4.302-cip115)
cip/4.4-rtAffected — no CIP fix yet (latest 4.4.302-cip115-rt63)