bpf: Fix missing -EFAULT return on user log buf error in btf_parse()
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 6 Apr 2023 23:41:54 +0000 (16:41 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 11 Apr 2023 16:05:43 +0000 (18:05 +0200)
commit971fb5057d787d0a7e7c8cb910207c82e2db920e
tree9e4340cffdef789e1df368ee3087c0d73b882011
parent24bc80887adb4d6fc0057d4f14fabeaa4502b2a0
bpf: Fix missing -EFAULT return on user log buf error in btf_parse()

btf_parse() is missing -EFAULT error return if log->ubuf was NULL-ed out
due to error while copying data into user-provided buffer. Add it, but
handle a special case of BPF_LOG_KERNEL in which log->ubuf is always NULL.

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-9-andrii@kernel.org
kernel/bpf/btf.c