]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit46a1145a9048828b781c3805a0af51554e636462
tree618344e6da0f9b13e2a9a5527eaa4987c662a548
parent8b61985f011fe84d7b8b1f450286c975c8390dc7
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