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>
Showing
- drivers/net/ethernet/netronome/nfp/bpf/verifier.c 14 additions, 10 deletionsdrivers/net/ethernet/netronome/nfp/bpf/verifier.c
- include/linux/bpf.h 12 additions, 22 deletionsinclude/linux/bpf.h
- include/linux/bpf_verifier.h 21 additions, 13 deletionsinclude/linux/bpf_verifier.h
- include/linux/tnum.h 79 additions, 0 deletionsinclude/linux/tnum.h
- kernel/bpf/Makefile 1 addition, 1 deletionkernel/bpf/Makefile
- kernel/bpf/tnum.c 164 additions, 0 deletionskernel/bpf/tnum.c
- kernel/bpf/verifier.c 974 additions, 806 deletionskernel/bpf/verifier.c
Loading
Please register or sign in to comment