]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Add sanity check for upper ptr_limit
authorPiotr Krysiuk <piotras@gmail.com>
Tue, 16 Mar 2021 08:47:02 +0000 (09:47 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 17 Mar 2021 20:57:39 +0000 (21:57 +0100)
commitf28f2c98fa8e6fc0d38034add6c5b3424335c726
tree2bff02cdb86111e2e17e49b066992fb5b41e0cfa
parent9aaf1c37b62a78cd59ece43d33f1092a7d1a4b4a
bpf: Add sanity check for upper ptr_limit

Given we know the max possible value of ptr_limit at the time of retrieving
the latter, add basic assertions, so that the verifier can bail out if
anything looks odd and reject the program. Nothing triggered this so far,
but it also does not hurt to have these.

Signed-off-by: Piotr Krysiuk <piotras@gmail.com>
Co-developed-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c