Tailcalls are been deprecated. So reject stack arguments if tail call is in the way. Signed-off-by: Yonghong Song --- kernel/bpf/verifier.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 20fb53ead728..45987041bb2a 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -7175,6 +7175,11 @@ static int check_max_stack_depth_subprog(struct bpf_verifier_env *env, int idx, verbose(env, "cannot tail call within exception cb\n"); return -EINVAL; } + if (subprog[tmp].incoming_stack_arg_depth || + subprog[tmp].outgoing_stack_arg_depth) { + verbose(env, "tail_calls are not allowed in programs with stack args\n"); + return -EINVAL; + } subprog[tmp].tail_call_reachable = true; } if (subprog[0].tail_call_reachable) -- 2.52.0