Commit 1cb0f56
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>1 parent 9325d53 commit 1cb0f56
File tree
4 files changed
+79
-83
lines changed- include/linux
- kernel/bpf
4 files changed
+79
-83
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
349 | 355 | | |
350 | 356 | | |
351 | 357 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
839 | 839 | | |
840 | 840 | | |
841 | 841 | | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
842 | 853 | | |
843 | 854 | | |
844 | 855 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7659 | 7659 | | |
7660 | 7660 | | |
7661 | 7661 | | |
7662 | | - | |
| 7662 | + | |
7663 | 7663 | | |
7664 | 7664 | | |
7665 | 7665 | | |
| |||
7683 | 7683 | | |
7684 | 7684 | | |
7685 | 7685 | | |
7686 | | - | |
| 7686 | + | |
7687 | 7687 | | |
7688 | 7688 | | |
7689 | 7689 | | |
| |||
0 commit comments