bpf/verifier: disallow pointer subtraction
authorAlexei Starovoitov <ast@kernel.org>
Wed, 12 Sep 2018 21:06:10 +0000 (14:06 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 12 Sep 2018 21:30:02 +0000 (23:30 +0200)
commitdd066823db2ac4e22f721ec85190817b58059a54
treef7f40317bb1474a382035fb58a120e73c82fec46
parent4b1c5d917d34f705096bb7dd8a2bd19b0881970e
bpf/verifier: disallow pointer subtraction

Subtraction of pointers was accidentally allowed for unpriv programs
by commit 82abbf8d2fc4. Revert that part of commit.

Fixes: 82abbf8d2fc4 ("bpf: do not allow root to mangle valid pointers")
Reported-by: Jann Horn <jannh@google.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/verifier.c