bpf: Make 32->64 bounds propagation slightly more robust
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 15 Dec 2021 22:28:48 +0000 (22:28 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:30:50 +0000 (09:30 +0100)
commit279e0bf80d95184666c9d41361b1625c045d1dcb
tree6347b5c80625217e6697e9b549996706104808bd
parente2aad0b5f2cbf71a31d00ce7bb4dee948adff5a9
bpf: Make 32->64 bounds propagation slightly more robust

commit e572ff80f05c33cd0cb4860f864f5c9c044280b6 upstream.

Make the bounds propagation in __reg_assign_32_into_64() slightly more
robust and readable by aligning it similarly as we did back in the
__reg_combine_64_into_32() counterpart. Meaning, only propagate or
pessimize them as a smin/smax pair.

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