]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: fix state equivalence
authorAlexei Starovoitov <ast@fb.com>
Wed, 7 Dec 2016 18:57:59 +0000 (10:57 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Dec 2016 18:31:11 +0000 (13:31 -0500)
commit746c124e1d6a4930e251a41247f7935ec99c5c65
treebc95a7d565111605886a99832603452c5f9bd8b1
parent9f28bbc9e56e7dd9c4264b20e4b7b3f6e444ed85
bpf: fix state equivalence

Commmits dfd8c149e273 ("bpf: Detect identical PTR_TO_MAP_VALUE_OR_NULL registers")
and a91a21eaf94f ("bpf: allow access into map value arrays") by themselves
are correct, but in combination they make state equivalence ignore 'id' field
of the register state which can lead to accepting invalid program.

Fixes: dfd8c149e273 ("bpf: Detect identical PTR_TO_MAP_VALUE_OR_NULL registers")
Fixes: a91a21eaf94f ("bpf: allow access into map value arrays")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/bpf_verifier.h
kernel/bpf/verifier.c