]> git.baikalelectronics.ru Git - kernel.git/commit
bpf/verifier: rework value tracking
authorEdward Cree <ecree@solarflare.com>
Mon, 7 Aug 2017 14:26:19 +0000 (15:26 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Aug 2017 00:51:34 +0000 (17:51 -0700)
commit8e11845d64e450b6c59ac3655fbaed9409f4f009
treed6e11577190ab47f4c371da21cf1f0f14da66db0
parent9d984245ecf9944897c7d46603099b57772b3eca
bpf/verifier: rework value tracking

Unifies adjusted and unadjusted register value types (e.g. FRAME_POINTER is
 now just a PTR_TO_STACK with zero offset).
Tracks value alignment by means of tracking known & unknown bits.  This
 also replaces the 'reg->imm' (leading zero bits) calculations for (what
 were) UNKNOWN_VALUEs.
If pointer leaks are allowed, and adjust_ptr_min_max_vals returns -EACCES,
 treat the pointer as an unknown scalar and try again, because we might be
 able to conclude something about the result (e.g. pointer & 0x40 is either
 0 or 0x40).
Verifier hooks in the netronome/nfp driver were changed to match the new
 data structures.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/bpf/verifier.c
include/linux/bpf.h
include/linux/bpf_verifier.h
include/linux/tnum.h [new file with mode: 0644]
kernel/bpf/Makefile
kernel/bpf/tnum.c [new file with mode: 0644]
kernel/bpf/verifier.c