Skip to contentSkip to conversation

CVE-2026-90359: bpf: Reject >8 byte return values on return-reading trampoline paths

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: Reject >8 byte return values on return-reading trampoline paths

btf_distill_func_proto() builds the function model used for the fentry/fexit/fmod_ret/fsession trampolines and struct_ops. It has accepted a 16-byte __int128 return value since the trampoline was
introduced: __get_type_size() returns the integer's type size, and the return-type check only rejected ret < 0.

But the BPF trampoline preserves only 8 bytes of the return value (RAX on x86, i.e. R0). For an attach type that reads the target's return value the second half (RDX / R3) is neither saved nor restored, so a program attached to a function returning a 16-byte value corrupts the value seen by the real caller and itself observes only half of it. struct_ops trampolines have the same limitation.

This affects the attach types that read the target's return value: fexit, fmod_ret and fsession (plus the _multi variants of fexit and fsession), and struct_ops. fentry/fentry_multi run before the target returns and are unaffected.

Reject a >8 byte return value for these attach types in bpf_check_attach_target() and bpf_check_attach_btf_id_multi(), and for struct_ops in bpf_struct_ops_desc_init().

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

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

	Issue introduced in 5.5 with commit fec56f5890d93fc2ed74166c397dc186b1c25951 and fixed in 7.2.6 with commit d36ac53fc83baf843c51b7afd6d2471f36b713d8
	Issue introduced in 5.5 with commit fec56f5890d93fc2ed74166c397dc186b1c25951 and fixed in 7.3-rc1 with commit c48796aa6c392cde93946e5d5a9a1f1b1cf72feb

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

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/bpf_struct_ops.c
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/d36ac53fc83baf843c51b7afd6d2471f36b713d8
	https://git.kernel.org/stable/c/c48796aa6c392cde93946e5d5a9a1f1b1cf72feb