bpf: Remove unnecessary ring buffer size check
authorHou Tao <houtao1@huawei.com>
Tue, 4 Jul 2023 07:40:14 +0000 (15:40 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 5 Jul 2023 12:09:45 +0000 (14:09 +0200)
commitcf6eeb8f9dace014f63a3b2e959d0922bf737233
treed2efd5fe22d2bc2c637beab4c7a46268fcf77d64
parentc20f9cef725bc6b19efe372696e8000fb5af0d46
bpf: Remove unnecessary ring buffer size check

The theoretical maximum size of ring buffer is about 64GB, but now the
size of ring buffer is specified by max_entries in bpf_attr and its
maximum value is (4GB - 1), and it won't be possible for overflow.

So just remove the unnecessary size check in ringbuf_map_alloc() but
keep the comments for possible extension in future.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Closes: https://lore.kernel.org/bpf/9c636a63-1f3d-442d-9223-96c2dccb9469@moroto.mountain
Link: https://lore.kernel.org/bpf/20230704074014.216616-1-houtao@huaweicloud.com
kernel/bpf/ringbuf.c