bpf, verifier: add additional patterns to evaluate_reg_imm_alu
authorJohn Fastabend <john.fastabend@gmail.com>
Sun, 2 Jul 2017 00:13:30 +0000 (02:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Aug 2017 08:21:43 +0000 (10:21 +0200)
commite37bdeee95a4a714dadc9743c86d8822c87038ac
tree0a67a1a9769f3c704cb6024960fd09a18a5a4616
parent7fa2fdf9f19e3b4bc71051c115271741369b5e7f
bpf, verifier: add additional patterns to evaluate_reg_imm_alu

[ Upstream commit 43188702b3d98d2792969a3377a30957f05695e6 ]

Currently the verifier does not track imm across alu operations when
the source register is of unknown type. This adds additional pattern
matching to catch this and track imm. We've seen LLVM generating this
pattern while working on cilium.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/bpf/verifier.c