]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Sep 2021 08:08:15 +0000 (10:08 +0200)
commit324db41d5f93048d5a14fff0af8c085ceab55f92
treeda65d495cf2a460c4785648a0def4bc79527312b
parent49e172071c2adcd080fa04060c0b9baa5d3edb88
bpf: Track contents of read-only maps as scalars

commit 46a1145a9048828b781c3805a0af51554e636462 upstream.

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
Signed-off-by: Rafael David Tinoco <rafaeldtinoco@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/bpf/verifier.c