---
id: CVE-2026-31401
title: |-
  In the Linux kernel, the following vulnerability has been resolved:

  HID: bpf: prevent buffer overflow in hid_hw_request

  right now the returned value is considered to be always valid
summary: |-
  In the Linux kernel, the following vulnerability has been resolved:

  HID: bpf: prevent buffer overflow in hid_hw_request

  right now the returned value is considered to be always valid. However,
  when playing with HID-BPF, the return value…
severity: high
cvss: 7.8
cvssVector: 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'
cwe:
  - CWE-787
vendor: linux
product: linux_kernel
affected:
  - 'linux_kernel >= 6.11, < 6.12.78'
  - 'linux_kernel >= 6.13, < 6.18.20'
  - 'linux_kernel >= 6.19, < 6.19.10'
  - linux_kernel = 7.0
patched:
  - linux_kernel 6.19.10
published: '2026-04-03'
updated: '2026-07-24'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-31401'
references:
  - url: 'https://git.kernel.org/stable/c/2b658c1c442ec1cd9eec5ead98d68662c40fe645'
    label: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
  - url: 'https://git.kernel.org/stable/c/73c5b5aea1c443239c8cb4191b4af7a4bd6fd7b1'
    label: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
  - url: 'https://git.kernel.org/stable/c/d6efaa50af62fb0790dd1fd4e7e5506b46312510'
    label: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
  - url: 'https://git.kernel.org/stable/c/eb57dae20fdf6f3069cdc07821fa3bb46de381d7'
    label: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
tags:
  - nvd
epss: 0.00189
epssPercentile: 0.07565
ingestedAt: '2026-07-25T22:05:04.273Z'
---

## Overview

In the Linux kernel, the following vulnerability has been resolved:

HID: bpf: prevent buffer overflow in hid_hw_request

right now the returned value is considered to be always valid. However,
when playing with HID-BPF, the return value can be arbitrary big,
because it's the return value of dispatch_hid_bpf_raw_requests(), which
calls the struct_ops and we have no guarantees that the value makes
sense.

## Affected

- `linux_kernel >= 6.11, < 6.12.78`
- `linux_kernel >= 6.13, < 6.18.20`
- `linux_kernel >= 6.19, < 6.19.10`
- `linux_kernel = 7.0`

## Remediation

Upgrade past the affected range:

- `linux_kernel 6.19.10`
