Commit 03cc3aa6 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Daniel Borkmann

bpf: Remove minimum size restrictions on verifier log buffer

It's not clear why we have 128 as minimum size, but it makes testing
harder and seems unnecessary, as we carefully handle truncation
scenarios and use proper snprintf variants. So remove this limitation
and just enforce positive length for log buffer.
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarLorenz Bauer <lmb@isovalent.com>
Link: https://lore.kernel.org/bpf/20230406234205.323208-3-andrii@kernel.org
parent 4294a0a7
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
bool bpf_verifier_log_attr_valid(const struct bpf_verifier_log *log) bool bpf_verifier_log_attr_valid(const struct bpf_verifier_log *log)
{ {
return log->len_total >= 128 && log->len_total <= UINT_MAX >> 2 && return log->len_total > 0 && log->len_total <= UINT_MAX >> 2 &&
log->level && log->ubuf && !(log->level & ~BPF_LOG_MASK); log->level && log->ubuf && !(log->level & ~BPF_LOG_MASK);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment