CVE-2025-38016: HID: bpf: abort dispatch if device destroyed
In the Linux kernel, the following vulnerability has been resolved:
HID: bpf: abort dispatch if device destroyed
The current HID bpf implementation assumes no output report/request will
go through it after hid_bpf_destroy_device() has been called. This leads
to a bug that unplugging certain types of HID devices causes a cleaned-
up SRCU to be accessed. The bug was previously a hidden failure until a
recent x86 percpu change [1] made it access not-present pages.
The bug will be triggered if the conditions below are met:
A) a device under the driver has some LEDs on
B) hid_ll_driver->request() is uninplemented (e.g., logitech-djreceiver)
If condition A is met, hidinput_led_worker() is always scheduled *after*
hid_bpf_destroy_device().
hid_destroy_device
` hid_bpf_destroy_device
` cleanup_srcu_struct(&hdev->bpf.srcu)
` hid_remove_device
` ...
` led_classdev_unregister
` led_trigger_set(led_cdev, NULL)
` led_set_brightness(led_cdev, LED_OFF)
` ...
` input_inject_event
` input_event_dispose
` hidinput_input_event
` schedule_work(&hid->led_work) [hidinput_led_worker]
This is fine when condition B is not met, where hidinput_led_worker()
calls hid_ll_driver->request(). This is the case for most HID drivers,
which implement it or use the generic one from usbhid. The driver itself
or an underlying driver will then abort processing the request.
Otherwise, hidinput_led_worker() tries hid_hw_output_report() and leads
to the bug.
hidinput_led_worker
` hid_hw_output_report
` dispatch_hid_bpf_output_report
` srcu_read_lock(&hdev->bpf.srcu)
` srcu_read_unlock(&hdev->bpf.srcu, idx)
The bug has existed since the introduction [2] of
dispatch_hid_bpf_output_report(). However, the same bug also exists in
dispatch_hid_bpf_raw_requests(), and I've reproduced (no visible effect
because of the lack of [1], but confirmed bpf.destroyed == 1) the bug
against the commit (i.e., the Fixes:) introducing the function. This is
because hidinput_led_worker() falls back to hid_hw_raw_request() when
hid_ll_driver->output_report() is uninplemented (e.g., logitech-
djreceiver).
hidinput_led_worker
` hid_hw_output_report: -ENOSYS
` hid_hw_raw_request
` dispatch_hid_bpf_raw_requests
` srcu_read_lock(&hdev->bpf.srcu)
` srcu_read_unlock(&hdev->bpf.srcu, idx)
Fix the issue by returning early in the two mentioned functions if
hid_bpf has been marked as destroyed. Though
dispatch_hid_bpf_device_event() handles input events, and there is no
evidence that it may be called after the destruction, the same check, as
a safety net, is also added to it to maintain the consistency among all
dispatch functions.
The impact of the bug on other architectures is unclear. Even if it acts
as a hidden failure, this is still dangerous because it corrupts
whatever is on the address calculated by SRCU. Thus, CC'ing the stable
list.
[1]: commit 9d7de2aa8b41 ("x86/percpu/64: Use relative percpu offsets")
[2]: commit 9286675a2aed ("HID: bpf: add HID-BPF hooks for
hid_hw_output_report")
Security readout for executives and security teams
Plain-English summary
A Linux kernel flaw can access already-cleaned memory when certain HID devices are unplugged while their LEDs are active. The documented trigger requires a driver lacking a request handler. This can corrupt kernel memory and potentially compromise confidentiality, integrity, or availability, although architecture-specific impact remains uncertain.
Executive priority
Treat as a high-priority kernel update for endpoints, kiosks, shared systems, and other hosts accepting removable HID devices. Broader emergency action is not supported because exploitation is unconfirmed and the trigger is conditional. Use normal accelerated patching, with earlier remediation where device access is less controlled.
Technical view
HID-BPF output or raw-request dispatch can enter an SRCU read section after hid_bpf_destroy_device() cleans that SRCU structure. A delayed LED worker creates the race when a qualifying device is removed. The kernel fix makes HID-BPF dispatch functions return early after the device is marked destroyed.
Likely exposure
Exposure is limited to Linux systems running affected kernels with HID-BPF and a qualifying HID driver or device combination. The source specifically identifies devices with active LEDs and an unimplemented request handler, citing logitech-djreceiver as an example. The supplied version data lists 6.11, 6.12.30, 6.14.8, and 6.15 but is not a clear range specification.
Exploitation context
The CVSS score is 8.8 with adjacent access, no privileges, and no user interaction. The supplied record is not in KEV and provides no evidence of active exploitation. Triggering depends on particular HID state and driver behavior; practical exploitability beyond causing memory corruption is not established by the sources.
Researcher notes
The issue is a post-destruction SRCU access in HID-BPF dispatch paths, with possible corruption of memory at the calculated SRCU address. The fix adds destroyed-state guards to output-report, raw-request, and device-event dispatch. Impact on non-x86 architectures is explicitly unclear. The supplied affected-version array is ambiguous and includes an anomalous "0", so authoritative distribution mapping is required.
Mitigation direction
Install a vendor-supported kernel containing the referenced stable fix.
Check distribution advisories to map package versions to the corrected kernel commits.
Prioritize systems where untrusted or removable HID devices can be connected.
Restrict physical and adjacent access to exposed systems until updates are applied.
Validation and detection
Inventory running kernel versions and distribution package revisions.
Confirm the installed kernel includes the applicable referenced stable commit.
Identify systems using HID devices with LEDs and drivers lacking request handling.
Review kernel logs for faults occurring during HID device removal.
Test device removal safely after patching without attempting exploitation.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-38016 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
0ADP providers
4Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.