]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Tidy up verifier check_func_arg()
authorJoanne Koong <joannelkoong@gmail.com>
Tue, 12 Jul 2022 21:06:03 +0000 (14:06 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 13 Jul 2022 21:45:58 +0000 (14:45 -0700)
commitd1643ca2733b60040235c81b9e7a94f550229ae0
tree76cea5c5b7aaad1c7f0b8c4b78fe7d8b22dd5717
parent59e049827bd03e8766190313d38f8130446a3936
bpf: Tidy up verifier check_func_arg()

This patch does two things:

1. For matching against the arg type, the match should be against the
base type of the arg type, since the arg type can have different
bpf_type_flags set on it.

2. Uses switch casing to improve readability + efficiency.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Acked-by: Hao Luo <haoluo@google.com>
Link: https://lore.kernel.org/r/20220712210603.123791-1-joannelkoong@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c