bpf: reject non-exact register type matches in regsafe()
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 23 Dec 2022 05:49:18 +0000 (21:49 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 28 Dec 2022 01:37:07 +0000 (17:37 -0800)
commit910f69996674bfc4a273a335c1fb2ecb45062bf6
tree9eefbebd82faec7d3de539529850f73d0b0e4874
parent7f4ce97cd5edf723c7f2e32668481b6aa86c9ec6
bpf: reject non-exact register type matches in regsafe()

Generalize the (somewhat implicit) rule of regsafe(), which states that
if register types in old and current states do not match *exactly*, they
can't be safely considered equivalent.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20221223054921.958283-5-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c