CVE-2026-139780: bpf: Reject oversized stream read buffers
In the Linux kernel, the following vulnerability has been resolved:
bpf: Reject oversized stream read buffers
BPFPROGSTREAMREADBYFD exposes streambuflen as a u32, but the internal stream reader accepts an int. Values above INTMAX therefore become negative before bpfstreamread(), producing negative consumption lengths. The generic usercopy size check prevents the oversized copy, but emits a warning and reports EFAULT for an unchecked argument.
Change bpfprogstreamread() to accept u32 and reject values that the signed reader cannot represent.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Change bpf_prog_stream_read() to accept stream_buf_len as u32 and reject values above INT_MAX before passing them to the internal reader.
Event History
Frequently Asked Questions
What input is required to trigger the issue?
An oversized stream read buffer length greater than INT_MAX must be supplied through BPF_PROG_STREAM_READ_BY_FD. The value is exposed as a u32 but was passed to an internal reader that accepts an int.
What happens on affected kernels when this is attempted?
The oversized value becomes negative before bpf_stream_read(), resulting in a negative consumption length. The generic usercopy size check prevents the oversized copy, emits a warning, and returns EFAULT for the unchecked argument.
What is the mitigation if the fix cannot be deployed immediately?
Avoid issuing BPF_PROG_STREAM_READ_BY_FD requests with stream_buf_len values above INT_MAX. The resolved behavior is to reject values that cannot be represented by the signed internal reader.