# CVE-2025-38016: HID: bpf: abort dispatch if device destroyed

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.8
- **CVSS:** 8.8 (v3.1, CNA) `CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Adjacent network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.35% (percentile 21, 2026-11-26)
- **Published:** 2025-06-18T09:28:24.883Z
- **Modified:** 2026-08-05T11:58:58.847Z

## Who should check

- Anyone running Linux \>= 8bd0488b5ea58655ad6fdcbe0408ef49b16882b1, \< f8544be7e8e55b0ef23e1ab90e23e8d4d4aad3d3; \>= 8bd0488b5ea58655ad6fdcbe0408ef49b16882b1, \< e4b4fe25a4101d1ddb5884f40e149a3618983b66; \>= 8bd0488b5ea58655ad6fdcbe0408ef49b16882b1, \< 578e1b96fad7402ff7e9c7648c8f1ad0225147c8
- Anyone running Linux 6.11

## Description

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")

## Affected and fixed versions

- Linux: \>= 8bd0488b5ea58655ad6fdcbe0408ef49b16882b1, \< f8544be7e8e55b0ef23e1ab90e23e8d4d4aad3d3; \>= 8bd0488b5ea58655ad6fdcbe0408ef49b16882b1, \< e4b4fe25a4101d1ddb5884f40e149a3618983b66; \>= 8bd0488b5ea58655ad6fdcbe0408ef49b16882b1, \< 578e1b96fad7402ff7e9c7648c8f1ad0225147c8 (cvelist)
- Linux: 6.11 (cvelist)

## Mitigation

- Upgrade Linux to 578e1b96fad7402ff7e9c7648c8f1ad0225147c8 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-38016. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-38016.md
Affected: Linux >= 8bd0488b5ea58655ad6fdcbe0408ef49b16882b1, < f8544be7e8e55b0ef23e1ab90e23e8d4d4aad3d3; >= 8bd0488b5ea58655ad6fdcbe0408ef49b16882b1, < e4b4fe25a4101d1ddb5884f40e149a3618983b66; >= 8bd0488b5ea58655ad6fdcbe0408ef49b16882b1, < 578e1b96fad7402ff7e9c7648c8f1ad0225147c8; Linux 6.11
Fixed in: Linux 578e1b96fad7402ff7e9c7648c8f1ad0225147c8

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-38016 being exploited?

There is no confirmed exploitation: CVE-2025-38016 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.35% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-38016?

High: CVSS 8.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-38016?

Linux \>= 8bd0488b5ea58655ad6fdcbe0408ef49b16882b1, \< f8544be7e8e55b0ef23e1ab90e23e8d4d4aad3d3; \>= 8bd0488b5ea58655ad6fdcbe0408ef49b16882b1, \< e4b4fe25a4101d1ddb5884f40e149a3618983b66; \>= 8bd0488b5ea58655ad6fdcbe0408ef49b16882b1, \< 578e1b96fad7402ff7e9c7648c8f1ad0225147c8; Linux 6.11.

### Is there a fix for CVE-2025-38016?

Yes. Fixed in Linux 578e1b96fad7402ff7e9c7648c8f1ad0225147c8. Upgrade Linux to 578e1b96fad7402ff7e9c7648c8f1ad0225147c8 or later.

### How do I check if I'm affected by CVE-2025-38016?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/f8544be7e8e55b0ef23e1ab90e23e8d4d4aad3d3>
- patch: <https://git.kernel.org/stable/c/e4b4fe25a4101d1ddb5884f40e149a3618983b66>
- patch: <https://git.kernel.org/stable/c/578e1b96fad7402ff7e9c7648c8f1ad0225147c8>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-38016>

HTML: <https://flawdb.com/CVE-2025-38016> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-38016>
