diff options
| author | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2026-08-23 21:32:00 +0200 |
|---|---|---|
| committer | Daniel Borkmann <daniel@iogearbox.net> | 2026-08-25 17:00:05 +0200 |
| commit | ea0b60fae724aa1147d4a07eda5131d3a9a9977e (patch) | |
| tree | 60aff849e1f145ade14448769207e71c1a56a6a3 /scripts | |
| parent | ce36e38beb6863664994f5676122359c8d323203 (diff) | |
| download | linux-next-ea0b60fae724aa1147d4a07eda5131d3a9a9977e.tar.gz linux-next-ea0b60fae724aa1147d4a07eda5131d3a9a9977e.zip | |
bpf: Reject oversized stream read buffers
BPF_PROG_STREAM_READ_BY_FD exposes stream_buf_len as a u32, but the
internal stream reader accepts an int. Values above INT_MAX therefore
become negative before bpf_stream_read(), 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 bpf_prog_stream_read() to accept u32 and reject values that the
signed reader cannot represent.
Fixes: 5ab154f1463a ("bpf: Introduce BPF standard streams")
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20260823193202.2389715-2-memxor@gmail.com
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
