Skip to content

Commit b724a64

Browse files
Asphalttanakryiko
authored andcommitted
bpf: Fix tr dereferencing
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: f7b12b6 ("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]
1 parent 9032598 commit b724a64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/bpf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,7 @@ static inline int bpf_trampoline_unlink_prog(struct bpf_tramp_link *link,
13071307
static inline struct bpf_trampoline *bpf_trampoline_get(u64 key,
13081308
struct bpf_attach_target_info *tgt_info)
13091309
{
1310-
return ERR_PTR(-EOPNOTSUPP);
1310+
return NULL;
13111311
}
13121312
static inline void bpf_trampoline_put(struct bpf_trampoline *tr) {}
13131313
#define DEFINE_BPF_DISPATCHER(name)

0 commit comments

Comments
 (0)