Merge branch 'bpf-ptrs-beyond-pkt-end'
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 13 Nov 2020 00:42:12 +0000 (01:42 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 13 Nov 2020 00:42:57 +0000 (01:42 +0100)
commit0a58a65cc0b0ebabbcf3cdae7642e6db29648164
tree9c3d86a8186c1284faf76bdbc98f60d720cd2b28
parentc36538798fc6c80bd8bdaddad803b0c86dc13d7c
parentcb62d34019d9117bb94de6ed35959449d43d6055
Merge branch 'bpf-ptrs-beyond-pkt-end'

Alexei Starovoitov says:

====================
v1->v2:
- removed set-but-unused variable.
- added Jiri's Tested-by.

In some cases LLVM uses the knowledge that branch is taken to optimze the code
which causes the verifier to reject valid programs.
Teach the verifier to recognize that
r1 = skb->data;
r1 += 10;
r2 = skb->data_end;
if (r1 > r2) {
  here r1 points beyond packet_end and subsequent
  if (r1 > r2) // always evaluates to "true".
}
====================

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>