CVE-2026-139327: bpf: Fix verifier WARN on narrow read of bpf_tcp_sock u64 fields
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix verifier WARN on narrow read of bpftcpsock u64 fields
A BPF program can read the middle of a u64 field in struct bpftcpsock:
tp = bpftcpsock(listener); / +0x54 is in the middle of the u64 bytesreceived / unsigned hi = (unsigned )((char )tp + 0x54);
bpftcpsockisvalidaccess() allows this 4-byte read (the default case only checks size == 4), but bpftcpsockconvertctxaccess() only knows the field starts and has no idea how to handle such an offset. It emits no instruction, cnt stays 0 and the fixup pass trips verifierbug():
verifier bug: error during ctx access conversion (0)
Just disallow the narrower access by matching the whole u64 range of the two fields, so it is turned down at check time:
invalid tcpsock access off=84 size=4
Affected Software
Event History
Frequently Asked Questions
What access does an attacker need to trigger this issue?
They need the ability to load or cause execution of a BPF program that accesses a bpf_tcp_sock context. The triggering program performs a 4-byte read from the middle of either affected 64-bit field.
What is the observable impact of an attempted exploit?
The BPF verifier reaches a verifier_bug() condition during context-access conversion and reports "verifier bug: error during ctx access conversion (0)". With the fix, the malformed access is rejected during verification as an invalid tcp_sock access.
Are ordinary aligned reads of the affected 64-bit fields blocked by the fix?
No. The change specifically disallows narrower reads that fall within the full 64-bit ranges of the affected fields, including bytes_received; it does not state that valid whole-field accesses are rejected.