Subject: Re: [PATCH net-next] bpf: fix verifier issue at check_packet_ptr_add

From: Daniel Borkmann <[email-masked]>
Date: Fri, 03 Feb 2017 09:37:08 +0100

On 02/03/2017 06:31 AM, William Tu wrote:
[...]
> Yes, this is auto-generated. We want to use P4 2016 as front end to
> generate ebpf for XDP.
>
[...]
> R2 is no longer pkt_end, it's R2 == R0 == 0
> 269: (bf) r2 = r0
> 270: (77) r2 >>= 3
> 271: (bf) r4 = r1
> 272: (0f) r4 += r2
>
> So at line 272, it's pkt_ptr = pkt_ptr + 0
> thus the following fix works for us.
> -               if (imm <= 0) {
> +               if (imm < 0) {

Okay, makes sense. I'll wait with ACK for your respin with kselftest
case.

Thanks,
Daniel