]> 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)
commita28322fd184c5af31689c6f92981ac38bacec71a
treecf1e780e43ad0667e2ef04ae14ce5bf98a47bb97
parentfdf4408d7ccf6ad0cdb662b78584f79fcb33d60b
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