aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/bpf.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2023-04-06 23:42:00 +0000
committerDaniel Borkmann <[email protected]>2023-04-11 16:05:44 +0000
commitfac08d45e2531f91d8fb3d11fc6576f588049476 (patch)
treeabf0852537b3d1911825b51e49e0a178316459e9 /tools/lib/bpf/bpf.c
parentbpf: Simplify internal verifier log interface (diff)
downloadkernel-fac08d45e2531f91d8fb3d11fc6576f588049476.tar.gz
kernel-fac08d45e2531f91d8fb3d11fc6576f588049476.zip
bpf: Relax log_buf NULL conditions when log_level>0 is requested
Drop the log_size>0 and log_buf!=NULL condition when log_level>0. This allows users to request log_true_size of a full log without providing actual (even if small) log buffer. Verifier log handling code was mostly ready to handle NULL log->ubuf, so only few small changes were necessary to prevent NULL log->ubuf from causing problems. Note, that if user provided NULL log_buf with log_level>0 we don't consider this a log truncation, and thus won't return -ENOSPC. We also enforce that either (log_buf==NULL && log_size==0) or (log_buf!=NULL && log_size>0). Suggested-by: Lorenz Bauer <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: Lorenz Bauer <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/bpf.c')
0 files changed, 0 insertions, 0 deletions