]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
bpf: Reject indirect var_off stack access in raw mode
authorAndrey Ignatov <rdna@fb.com>
Thu, 4 Apr 2019 06:22:37 +0000 (23:22 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 5 Apr 2019 14:50:07 +0000 (16:50 +0200)
commitf2bcd05ec7b839ff826d2008506ad2d2dff46a59
treedcd402f6de719741c4e554a45ec7610d6971b1e9
parent636e78b1cdb40b77a79b143dbd9d94847b360efa
bpf: Reject indirect var_off stack access in raw mode

It's hard to guarantee that whole memory is marked as initialized on
helper return if uninitialized stack is accessed with variable offset
since specific bounds are unknown to verifier. This may cause
uninitialized stack leaking.

Reject such an access in check_stack_boundary to prevent possible
leaking.

There are no known use-cases for indirect uninitialized stack access
with variable offset so it shouldn't break anything.

Fixes: 2011fccfb61b ("bpf: Support variable offset stack access from helpers")
Reported-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/verifier.c