bpf: Fix bpf_check_mod_kfunc_call for built-in modules
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Mon, 22 Nov 2021 14:47:41 +0000 (20:17 +0530)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 2 Dec 2021 21:39:46 +0000 (13:39 -0800)
commitb12f031043247b80999bf5e03b8cded3b0b40f8d
treedab61f9512dee774fa85bedee54ee70439f8a66a
parentd9847eb8be3d895b2b5f514fdf3885d47a0b92a2
bpf: Fix bpf_check_mod_kfunc_call for built-in modules

When module registering its set is built-in, THIS_MODULE will be NULL,
hence we cannot return early in case owner is NULL.

Fixes: 14f267d95fe4 ("bpf: btf: Introduce helpers for dynamic BTF set registration")
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20211122144742.477787-3-memxor@gmail.com
kernel/bpf/btf.c