]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, verifier: fix register type dump in xadd and st
authorDaniel Borkmann <daniel@iogearbox.net>
Sun, 21 Oct 2018 00:09:24 +0000 (02:09 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 21 Oct 2018 06:13:32 +0000 (23:13 -0700)
commitf15ff21c76c90862be5573b0128c01f4417d7320
tree060b9cfd0b2af614168f72923c8e76800f76659c
parent2f000c72e0189709623ec655b2c9dec518c2afe5
bpf, verifier: fix register type dump in xadd and st

Using reg_type_str[insn->dst_reg] is incorrect since insn->dst_reg
contains the register number but not the actual register type. Add
a small reg_state() helper and use it to get to the type. Also fix
up the test_verifier test cases that have an incorrect errstr.

Fixes: 30de6938e14a ("bpf: Reuse canonical string formatter for ctx errs")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c
tools/testing/selftests/bpf/test_verifier.c