mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 14:12:07 +02:00
bpf: Avoid incorrect -EFAULT error in BPF_LOG_KERNEL mode
If verifier log is in BPF_LOG_KERNEL mode, no log->ubuf is expected and it stays NULL throughout entire verification process. Don't erroneously return -EFAULT in such case. 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-10-andrii@kernel.org
This commit is contained in:
parent
971fb5057d
commit
cbedb42a0d
|
|
@ -18863,7 +18863,7 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr, bpfptr_t uattr)
|
|||
bpf_vlog_finalize(log);
|
||||
if (log->level && bpf_vlog_truncated(log))
|
||||
ret = -ENOSPC;
|
||||
if (log->level && !log->ubuf) {
|
||||
if (log->level && log->level != BPF_LOG_KERNEL && !log->ubuf) {
|
||||
ret = -EFAULT;
|
||||
goto err_release_maps;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user