From: Alexei Starovoitov <a...@fb.com> Date: Fri, 24 Mar 2017 15:57:33 -0700
> llvm can optimize the 'if (ptr > data_end)' checks to be in the order > slightly different than the original C code which will confuse verifier. > Like: > if (ptr + 16 > data_end) > return TC_ACT_SHOT; > // may be followed by > if (ptr + 14 > data_end) > return TC_ACT_SHOT; > while llvm can see that 'ptr' is valid for all 16 bytes, > the verifier could not. > Fix verifier logic to account for such case and add a test. > > Reported-by: Huapeng Zhou <hz...@fb.com> > Fixes: 969bf05eb3ce ("bpf: direct packet access") > Signed-off-by: Alexei Starovoitov <a...@kernel.org> > Acked-by: Daniel Borkmann <dan...@iogearbox.net> > Acked-by: Martin KaFai Lau <ka...@fb.com> Applied and queued up for -stable, thanks.