bpf: verifier: set reg_type on context accesses in second pass
authorJakub Kicinski <jakub.kicinski@netronome.com>
Thu, 12 Oct 2017 17:34:07 +0000 (10:34 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 14 Oct 2017 18:13:27 +0000 (11:13 -0700)
commit1bdec44955edc22fb840f5965987d2972307dcc9
tree5f463cef301621f07860e0a4023f940c03f8cab0
parent40d0af56350e7534bc11c9370670010cfa74cfa7
bpf: verifier: set reg_type on context accesses in second pass

Use a simplified is_valid_access() callback when verifier
is used for program analysis by non-host JITs.  This allows
us to teach the verifier about packet start and packet end
offsets for direct packet access.

We can extend the callback as needed but for most packet
processing needs there isn't much more the offloads may
require.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/bpf/verifier.c