Skip to contentSkip to conversation

CVE-2026-72352: HID: bpf: Fix hid_bpf_get_data() range check

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Aug 15

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

HID: bpf: Fix hid_bpf_get_data() range check

hid_bpf_get_data() returns a pointer into the HID-BPF context data when the caller-provided offset and size fit inside ctx->allocated_size.

The current check adds rdwr_buf_size and offset before comparing the result against ctx->allocated_size. Since both values are unsigned, a very large size can wrap the sum below ctx->allocated_size and make the helper return a pointer even though the requested range is not contained in the backing buffer.

Use check_add_overflow() to reject wrapped range ends before comparing the requested range end against ctx->allocated_size.

The Linux kernel CVE team has assigned CVE-2026-72352 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.3 with commit 658ee5a64fcfbbf758447fa3af425729eaabb0dc and fixed in 6.12.97 with commit ca373549140dfb386aa2de38364b58441b1f4885
	Issue introduced in 6.3 with commit 658ee5a64fcfbbf758447fa3af425729eaabb0dc and fixed in 6.18.40 with commit 61a959b82f1aecd6d2d35c208013dd077cac9d10
	Issue introduced in 6.3 with commit 658ee5a64fcfbbf758447fa3af425729eaabb0dc and fixed in 7.1.5 with commit f81bc5a709dcbaf2a3bbef4ca7167f93900cc39f
	Issue introduced in 6.3 with commit 658ee5a64fcfbbf758447fa3af425729eaabb0dc and fixed in 7.2-rc3 with commit 2d044049421dd48212b28646a850749d4a2d57fa

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-72352

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
drivers/hid/bpf/hid_bpf_dispatch.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/ca373549140dfb386aa2de38364b58441b1f4885
	https://git.kernel.org/stable/c/61a959b82f1aecd6d2d35c208013dd077cac9d10
	https://git.kernel.org/stable/c/f81bc5a709dcbaf2a3bbef4ca7167f93900cc39f
	https://git.kernel.org/stable/c/2d044049421dd48212b28646a850749d4a2d57fa