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)
commit9d7eceede769f90b66cfa06ad5b357140d5141ed
treecf1e780e43ad0667e2ef04ae14ce5bf98a47bb97
parente4298d25830a866cc0f427d4bccb858e76715859
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