Skip to main content
Vulnerability Database/CVE-2026-98860

CVE-2026-98860: Linux Kernel HID BPF Privilege Escalation

CVE-2026-98860 is a privilege escalation vulnerability in the Linux kernel HID BPF subsystem where hardware errors are incorrectly converted to success codes. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-98860 Overview

CVE-2026-98860 affects the Linux kernel's Human Interface Device (HID) subsystem, specifically the Berkeley Packet Filter (BPF) integration in hid_bpf_hw_request. The flaw is a signed/unsigned comparison error: when a transport driver returns a negative error code such as -EPIPE, the signed return value is implicitly promoted to size_t during a size comparison. The negative value becomes a very large positive number, and the error check passes as if the operation succeeded. The kernel then copies an unmodified buffer back to the caller, exposing BPF programs to uninitialized or stale data.

Critical Impact

Hardware I/O errors are silently converted to success, allowing HID BPF programs to process stale or uninitialized buffer contents from kernel memory.

Affected Products

  • Linux kernel versions containing the vulnerable hid_bpf_hw_request implementation
  • Systems using HID BPF programs for input device processing
  • Distributions shipping affected stable kernel branches prior to the referenced fix commits

Discovery Timeline

  • 2026-10-18 - CVE-2026-98860 published to NVD
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-98860

Vulnerability Analysis

The defect lies in a type-promotion mistake inside hid_bpf_hw_request. The function compares a signed ret value against an unsigned size parameter. In C, when a signed integer is compared with an unsigned type of equal or greater rank, the signed value is converted to unsigned. A negative error code such as -EPIPE (-32) therefore becomes a large unsigned integer, and the (ret > size) sanity check always evaluates true.

The practical consequence is that transport-layer hardware failures are not propagated to the HID BPF layer. Instead, the function returns a success path with the original request buffer intact. HID BPF programs that rely on the returned data then operate on contents that were never written by the hardware. Depending on the caller, this can leak previously resident buffer contents or cause the BPF program to act on inputs that do not reflect real device state.

Root Cause

The root cause is an input validation and type-handling defect classified as a signed-to-unsigned comparison error, related to numeric truncation and sign extension issues. The fix casts size to ssize_t so the comparison is performed in signed arithmetic, preserving the sign of ret and correctly surfacing the negative error code to callers.

Attack Vector

Triggering the condition requires a transport driver returning a negative error such as -EPIPE from an HID hardware request path. The vector is local and depends on the presence of attached HID hardware exhibiting I/O errors, or a malicious or malfunctioning USB/Bluetooth HID device that can induce transport failures. The impact is primarily on HID BPF program correctness and potential exposure of stale kernel buffer data rather than direct remote exploitation.

No verified public exploit code is available. See the upstream commits for technical details: Kernel Git Commit 97be639 and Kernel Git Commit 3afefbf.

Detection Methods for CVE-2026-98860

Indicators of Compromise

  • Kernel logs showing HID transport errors such as -EPIPE immediately followed by HID BPF programs returning success paths with unexpected input values.
  • Unexplained input device anomalies on hosts that load HID BPF programs, correlated with USB or Bluetooth HID disconnect or stall events.
  • Repeated dmesg entries from HID transport drivers reporting hardware errors on systems running custom HID BPF code.

Detection Strategies

  • Inventory kernel versions across Linux endpoints and flag hosts running kernels without the fix commits referenced in the NVD advisory.
  • Audit which systems load HID BPF programs via bpftool prog list and prioritize those for patching.
  • Review HID BPF program code for assumptions that the returned buffer always reflects a successful hardware read.

Monitoring Recommendations

  • Collect and centralize kernel logs to correlate HID transport error returns with downstream BPF program behavior.
  • Monitor BPF program load events and track changes to the set of attached HID BPF programs across the fleet.
  • Alert on recurring HID stall or pipe errors from the same device, which may indicate attempts to trigger the condition.

How to Mitigate CVE-2026-98860

Immediate Actions Required

  • Apply the stable kernel updates containing the referenced fix commits to all affected Linux systems.
  • Identify and inventory hosts that load HID BPF programs and prioritize them for patch deployment.
  • Review third-party or in-house HID BPF programs to confirm they handle negative return values from hid_bpf_hw_request correctly.

Patch Information

The upstream fix casts size to ssize_t in hid_bpf_hw_request so the comparison preserves the sign of ret and returns the actual negative error code. The fix is distributed across the following stable commits: Kernel Git Commit 97be639, Kernel Git Commit 3afefbf, Kernel Git Commit 8b85ef0, and Kernel Git Commit f9f8082. Apply vendor-provided kernel updates once distributions backport these commits.

Workarounds

  • Unload or avoid deploying HID BPF programs on unpatched kernels where feasible.
  • Restrict CAP_BPF and CAP_SYS_ADMIN to trusted administrators so unprivileged users cannot attach HID BPF programs.
  • Physically limit untrusted USB and Bluetooth HID devices on sensitive hosts until patches are deployed.
bash
# Verify running kernel version and installed BPF programs
uname -r
sudo bpftool prog show | grep -i hid

# Example: restrict unprivileged BPF usage
sudo sysctl -w kernel.unprivileged_bpf_disabled=1

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.