OSDN Git Service

bpf: don't prune branches when a scalar is replaced with a pointer
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 22 Dec 2017 15:23:10 +0000 (16:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Dec 2017 13:26:32 +0000 (14:26 +0100)
commitcb56cc1b292b8b3f787fad89f1208f8e98d12c7d
tree9a6309520b70f06850e13f3d8eb2289c5b5ac330
parentc90268f7cbee0781331b96d1423d0f28a6183889
bpf: don't prune branches when a scalar is replaced with a pointer

From: Jann Horn <jannh@google.com>

[ Upstream commit 179d1c5602997fef5a940c6ddcf31212cbfebd14 ]

This could be made safe by passing through a reference to env and checking
for env->allow_ptr_leaks, but it would only work one way and is probably
not worth the hassle - not doing it will not directly lead to program
rejection.

Fixes: f1174f77b50c ("bpf/verifier: rework value tracking")
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/bpf/verifier.c