Re: [PATCH bpf 1/2] bpf: Fix the corner case where may_goto is a 1st insn.

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

 



On Tue, 2024-06-18 at 11:42 -0700, Alexei Starovoitov wrote:
> From: Alexei Starovoitov <ast@xxxxxxxxxx>
> 
> When the following program is processed by the verifier:
> L1: may_goto L2
>     goto L1
> L2: w0 = 0
>     exit
> 
> the may_goto insn is first converted to:
> L1: r11 = *(u64 *)(r10 -8)
>     if r11 == 0x0 goto L2
>     r11 -= 1
>     *(u64 *)(r10 -8) = r11
>     goto L1
> L2: w0 = 0
>     exit

[...]

> 
> Reported-by: Zac Ecob <zacecob@xxxxxxxxxxxxxx>
> Closes: https://lore.kernel.org/bpf/CAADnVQJ_WWx8w4b=6Gc2EpzAjgv+6A0ridnMz2TvS2egj4r3Gw@xxxxxxxxxxxxxx/
> Fixes: 011832b97b31 ("bpf: Introduce may_goto instruction")
> Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx>
> ---

A tricky corner case indeed.
We should probably switch to normal basic blocks one day...

Acked-by: Eduard Zingerman <eddyz87@xxxxxxxxx>





[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