]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: restrict unknown scalars of mixed signed bounds for unprivileged
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 2 Jan 2019 23:58:32 +0000 (00:58 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 3 Jan 2019 00:01:24 +0000 (16:01 -0800)
commit0a73f66bd9a544581cc389de6332a1d5871a7d75
treecf1e780e43ad0667e2ef04ae14ce5bf98a47bb97
parent9e31503cfe4ab1f5a893e54fd9ae4f05422dfb43
bpf: restrict unknown scalars of mixed signed bounds for unprivileged

For unknown scalars of mixed signed bounds, meaning their smin_value is
negative and their smax_value is positive, we need to reject arithmetic
with pointer to map value. For unprivileged the goal is to mask every
map pointer arithmetic and this cannot reliably be done when it is
unknown at verification time whether the scalar value is negative or
positive. Given this is a corner case, the likelihood of breaking should
be very small.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c