Skip to contentSkip to conversation

CVE-2026-98628: bpf: Make post-verification instruction rewrites killable

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Oct 18

lore
Share & tools
lore
#0 lore raw

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

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

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

bpf: Make post-verification instruction rewrites killable

After do_check() returns, the verifier runs several instruction rewrite passes. Some of them patch or remove one instruction at a time. Each operation moves the remaining instruction and auxiliary-data arrays and adjusts all branch offsets, making the overall work quadratic in the program length.

A privileged loader can submit 131072 unconditional jumps by zero followed by a valid return. Verification finishes quickly, but bpf_opt_remove_nops() then spends a long time removing each jump separately. Since this post-verification work neither checks for signals nor reschedules, a pending SIGKILL cannot terminate the task until the rewrite finishes.

Make bpf_patch_insn_data() and verifier_remove_insns() common cancellation and rescheduling points. These helpers run from BPF_PROG_LOAD process context, and bpf_patch_insn_data() can already sleep while reallocating auxiliary data.

Report interrupted constant blinding as -EINTR and propagate it through both JIT paths, including kernels that permit interpreter fallback. Other blinding failures retain the existing fallback behavior.

This does not reduce the quadratic cost of the rewrite passes, but it makes the work preemptible and allows a killed loader to be torn down promptly.

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

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

	Issue introduced in 5.1 with commit 52875a04f4b26e7ef30a288ea096f7cfec0e93cd and fixed in 7.2.9 with commit 56dc616d7a1f7d134d3e101c455e62b0a24d0cfd
	Issue introduced in 5.1 with commit 52875a04f4b26e7ef30a288ea096f7cfec0e93cd and fixed in 7.3-rc5 with commit 261b61d3735b042ae25634f795c4540be0fc140c

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-98628

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
kernel/bpf/fixups.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/56dc616d7a1f7d134d3e101c455e62b0a24d0cfd
	https://git.kernel.org/stable/c/261b61d3735b042ae25634f795c4540be0fc140c