bpf: Track contents of read-only maps as scalars
authorAndrii Nakryiko <andriin@fb.com>
Wed, 9 Oct 2019 20:14:57 +0000 (13:14 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 10 Oct 2019 23:49:15 +0000 (01:49 +0200)
commita23740ec43ba022dbfd139d0fe3eff193216272b
tree618344e6da0f9b13e2a9a5527eaa4987c662a548
parente0b68fb186b251374adbd870f99b1ecea236e770
bpf: Track contents of read-only maps as scalars

Maps that are read-only both from BPF program side and user space side
have their contents constant, so verifier can track referenced values
precisely and use that knowledge for dead code elimination, branch
pruning, etc. This patch teaches BPF verifier how to do this.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191009201458.2679171-2-andriin@fb.com
kernel/bpf/verifier.c