Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bpf: Do not increment tailcall count when prog is NULL

Currently, tailcall count is incremented in the interpreter even when
tailcall fails due to non-existent prog. Fix this by holding off on
the tailcall count increment until after NULL check on the prog.

Suggested-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Link: https://lore.kernel.org/r/20260220062959.195101-1-hbathini@linux.ibm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Hari Bathini and committed by
Alexei Starovoitov
3733f4be 055d8dd5

+2 -2
+2 -2
kernel/bpf/core.c
··· 2060 2060 if (unlikely(tail_call_cnt >= MAX_TAIL_CALL_CNT)) 2061 2061 goto out; 2062 2062 2063 - tail_call_cnt++; 2064 - 2065 2063 prog = READ_ONCE(array->ptrs[index]); 2066 2064 if (!prog) 2067 2065 goto out; 2066 + 2067 + tail_call_cnt++; 2068 2068 2069 2069 /* ARG1 at this point is guaranteed to point to CTX from 2070 2070 * the verifier side due to the fact that the tail call is