]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bpf: WARN_ONCE on verifier bugs
authorPaul Chaignon <paul.chaignon@gmail.com>
Mon, 19 May 2025 13:43:57 +0000 (15:43 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 19 May 2025 15:17:08 +0000 (08:17 -0700)
commit1cb0f56d96185cb20e63e191fc291191823e6f52
tree21b5443858a01d4ad954fcfab323972d96a9a52c
parent9325d53fe9adff354b6a93fda5f38c165947da0f
bpf: WARN_ONCE on verifier bugs

Throughout the verifier's logic, there are multiple checks for
inconsistent states that should never happen and would indicate a
verifier bug. These bugs are typically logged in the verifier logs and
sometimes preceded by a WARN_ONCE.

This patch reworks these checks to consistently emit a verifier log AND
a warning when CONFIG_DEBUG_KERNEL is enabled. The consistent use of
WARN_ONCE should help fuzzers (ex. syzkaller) expose any situation
where they are actually able to reach one of those buggy verifier
states.

Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Link: https://lore.kernel.org/r/aCs1nYvNNMq8dAWP@mail.gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
include/linux/bpf_verifier.h
kernel/bpf/btf.c
kernel/bpf/verifier.c