bpf: Refactor and streamline bounds check into helper
authorDaniel Borkmann <daniel@iogearbox.net>
Tue, 23 Mar 2021 14:05:48 +0000 (15:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Apr 2021 11:40:00 +0000 (13:40 +0200)
commit2982ea926b5cb97ff79fbb27eba72521568811ff
tree019462787e1786a0f75697e7c22fd26f6b5eee15
parentf3c4b01689d392373301e6e60d1b02c5b4020afc
bpf: Refactor and streamline bounds check into helper

[ Upstream commit 073815b756c51ba9d8384d924c5d1c03ca3d1ae4 ]

Move the bounds check in adjust_ptr_min_max_vals() into a small helper named
sanitize_check_bounds() in order to simplify the former a bit.

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: Sasha Levin <sashal@kernel.org>
kernel/bpf/verifier.c