]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Reuse canonical string formatter for ctx errs
authorJoe Stringer <joe@wand.net.nz>
Tue, 2 Oct 2018 20:35:31 +0000 (13:35 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 3 Oct 2018 00:53:47 +0000 (02:53 +0200)
commit30de6938e14a9d6b6c8f068a8044b944b2a9fb26
treeb38b5e13726c1808d4ed5cf5bcaf882c3e25fdb3
parent057d054e493e0e7835a312a3d8806d115775c81c
bpf: Reuse canonical string formatter for ctx errs

The array "reg_type_str" provides canonical formatting of register
types, however a couple of places would previously check whether a
register represented the context and write the name "context" directly.
An upcoming commit will add another pointer type to these statements, so
to provide more accurate error messages in the verifier, update these
error messages to use "reg_type_str" instead.

Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/verifier.c
tools/testing/selftests/bpf/test_verifier.c