Re: [PATCH bpf] bpf: Fix tail_call_reachable rejection for interpreter when jit failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 13, 2021 at 3:58 AM Daniel Borkmann <daniel@xxxxxxxxxxxxx> wrote:
> >>
> >> Fixes: ebf7d1f508a7 ("bpf, x64: rework pro/epilogue and tailcall handling in JIT")
> >> Fixes: e411901c0b77 ("bpf: allow for tailcalls in BPF subprograms for x64 JIT")
> >> Signed-off-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
> >> Co-developed-by: John Fastabend <john.fastabend@xxxxxxxxx>
> >> Signed-off-by: John Fastabend <john.fastabend@xxxxxxxxx>
> >> Cc: Maciej Fijalkowski <maciej.fijalkowski@xxxxxxxxx>
> >> ---
> >>   kernel/bpf/verifier.c | 2 ++
> >>   1 file changed, 2 insertions(+)
> >>
> >> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> >> index 42a4063de7cd..9de3c9c3267c 100644
> >> --- a/kernel/bpf/verifier.c
> >> +++ b/kernel/bpf/verifier.c
> >> @@ -3677,6 +3677,8 @@ static int check_max_stack_depth(struct bpf_verifier_env *env)
> >>      if (tail_call_reachable)
> >>              for (j = 0; j < frame; j++)
> >>                      subprog[ret_prog[j]].tail_call_reachable = true;
> >> +    if (subprog[0].tail_call_reachable)
> >
> > This could be just:
> >       if (tail_call_reachable)
> >
> > But what you propose is fine to me as well. Not sure how we missed it.
> > Acked-by: Maciej Fijalkowski <maciej.fijalkowski@xxxxxxxxx>
>
> Thanks! Yeah I wanted to also use subprog[0] here given this really denotes
> the main prog. We have a similar case elsewhere too where we set the stack
> depth for env->prog->aux->stack_depth from env->subprog_info[0].stack_depth.

Applied. Thanks



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux