summaryrefslogtreecommitdiff
path: root/kernel/bpf
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2023-04-07 02:41:48 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2023-04-11 19:05:42 +0300
commit03cc3aa6a53394481f01c16231f99298332066f9 (patch)
tree0ca2a4618d90b0155ebba87d58e4fea371626c36 /kernel/bpf
parent4294a0a7ab6282c3d92f03de84e762dda993c93d (diff)
downloadlinux-03cc3aa6a53394481f01c16231f99298332066f9.tar.xz
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: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Lorenz Bauer <lmb@isovalent.com> Link: https://lore.kernel.org/bpf/20230406234205.323208-3-andrii@kernel.org
Diffstat (limited to 'kernel/bpf')
-rw-r--r--kernel/bpf/log.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/log.c b/kernel/bpf/log.c
index 920061e38d2e..1974891fc324 100644
--- a/kernel/bpf/log.c
+++ b/kernel/bpf/log.c
@@ -11,7 +11,7 @@
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);
}