CVE-2026-98816: bpf: Fix overflow of jump offset in constant blinding
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix overflow of jump offset in constant blinding
bpf_jit_blind_insn() rewrites 'if rX op imm goto off' into:
AX = imm ^ rnd
AX ^= rnd
if rX op AX goto off
and subtracts 2 from off when the jump is backward. off is s16, so -32767 and -32768 wrap and the jump goes 32767 insns forward, past the end of the prog. The jump is inside the patch, hence bpf_adj_branches() doesn't check it. The kernel crashes when such prog runs with bpf_jit_harden=2.
Return -ERANGE in such case. bpf_jit_blind_constants() fails the same way when blinding of other insns moves a jump out of range.
The Linux kernel CVE team has assigned CVE-2026-98816 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.7 with commit 4f3446bb809f20ad56cadf712e6006815ae7a8f9 and fixed in 7.2.10 with commit 443328237113ee0ea515e506497334d871dbc2aa Issue introduced in 4.7 with commit 4f3446bb809f20ad56cadf712e6006815ae7a8f9 and fixed in 7.3-rc6 with commit ad139384ecddb6f3e7e3c3c12765aafae0e39670
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-98816
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:
kernel/bpf/core.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/443328237113ee0ea515e506497334d871dbc2aa https://git.kernel.org/stable/c/ad139384ecddb6f3e7e3c3c12765aafae0e39670