Skip to contentSkip to conversation

CVE-2026-93127: bpf: Drop scalar id on sign-extending narrowing stack fills

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Sep 17

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: Drop scalar id on sign-extending narrowing stack fills

When a spilled scalar is filled back with a sign-extending narrowing load (BPF_MEMSX), check_stack_read_fixed_off() copies the spilled register including its scalar id, but coerce_reg_to_size_sx() then sign-extends the filled register's value. If the same slot is also filled with a plain zero-extending load (BPF_MEM), both destination registers share the id yet hold different values. A later 'if <zext-reg> == const' then refines the sign-extended register through sync_linked_regs() to a value it does not have at runtime (e.g. the verifier believes 0x80000000 while the register is 0xffffffff80000000), which can be turned into an out-of-bounds access.

Drop the shared scalar id at the sign-extension site in check_mem_access() when sign extension actually changes the value, mirroring the BPF_MOVSX handling in check_alu_op() (no_sext = reg_umax < 2^(size*8-1)).

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

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

	Issue introduced in 7.0 with commit 3cd5c890652ba1f0682adc291b5446245259b692 and fixed in 7.2.6 with commit f3614622dc41f3dd99bb4f691da253814e4e6cae
	Issue introduced in 7.0 with commit 3cd5c890652ba1f0682adc291b5446245259b692 and fixed in 7.3-rc1 with commit 2cb5f4ca695ebe552647e5ba4aad6934d6a43bae

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

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/verifier.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/f3614622dc41f3dd99bb4f691da253814e4e6cae
	https://git.kernel.org/stable/c/2cb5f4ca695ebe552647e5ba4aad6934d6a43bae