bpf, ringbuf: Deny reserve of buffers larger than ringbuf
A BPF program might try to reserve a buffer larger than the ringbuf size.
If the consumer pointer is way ahead of the producer, that would be
successfully reserved, allowing the BPF program to read or write out of
the ringbuf allocated area.
Reported-by: Ryota Shiga (Flatt Security)
Fixes: 457f44363a88 ("bpf: Implement BPF ring buffer and verifier support for it")
Signed-off-by: Thadeu Lima de Souza Cascardo <firstname.lastname@example.org>
Signed-off-by: Daniel Borkmann <email@example.com>
Acked-by: Andrii Nakryiko <firstname.lastname@example.org>
Acked-by: Alexei Starovoitov <email@example.com>
1 file changed