commit | 163042a01544b72fab9ebec77ac3969437d53158 | [log] [tgz] |
---|---|---|
author | Leon Hwang <[email protected]> | Sun Sep 17 23:38:46 2023 +0800 |
committer | Greg Kroah-Hartman <[email protected]> | Tue Oct 10 22:00:40 2023 +0200 |
tree | af6216ba11f073184db8f4eb897728873bf0beea | |
parent | c14c7214fc68ec003c7ec7b36598da2d89d47421 [diff] [blame] |
bpf: Fix tr dereferencing [ Upstream commit b724a6418f1f853bcb39c8923bf14a50c7bdbd07 ] Fix 'tr' dereferencing bug when CONFIG_BPF_JIT is turned off. When CONFIG_BPF_JIT is turned off, 'bpf_trampoline_get()' returns NULL, which is same as the cases when CONFIG_BPF_JIT is turned on. Closes: https://lore.kernel.org/r/[email protected]/ Fixes: f7b12b6fea00 ("bpf: verifier: refactor check_attach_btf_id()") Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Leon Hwang <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected] Signed-off-by: Sasha Levin <[email protected]>
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 1ed2ec0..1fba826 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h
@@ -1065,7 +1065,7 @@ static inline int bpf_trampoline_unlink_prog(struct bpf_tramp_link *link, static inline struct bpf_trampoline *bpf_trampoline_get(u64 key, struct bpf_attach_target_info *tgt_info) { - return ERR_PTR(-EOPNOTSUPP); + return NULL; } static inline void bpf_trampoline_put(struct bpf_trampoline *tr) {} #define DEFINE_BPF_DISPATCHER(name)