]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Teach stack depth check about async callbacks.
authorAlexei Starovoitov <ast@kernel.org>
Thu, 15 Jul 2021 00:54:15 +0000 (17:54 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 15 Jul 2021 20:31:10 +0000 (22:31 +0200)
commit3abc8eb992c406a9d81be5fa727ca7f0e856352f
tree18cf3ae170f0b9292698f94128dd44afd57de356
parentc8cc02bbce310a65c740646fe071d5fdaac4c965
bpf: Teach stack depth check about async callbacks.

Teach max stack depth checking algorithm about async callbacks
that don't increase bpf program stack size.
Also add sanity check that bpf_tail_call didn't sneak into async cb.
It's impossible, since PTR_TO_CTX is not available in async cb,
hence the program cannot contain bpf_tail_call(ctx,...);

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/20210715005417.78572-10-alexei.starovoitov@gmail.com
include/linux/bpf_verifier.h
kernel/bpf/verifier.c