mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
bpf: print full verifier states on infinite loop detection
commit b4d8239534
upstream.
Additional logging in is_state_visited(): if infinite loop is detected
print full verifier state for both current and equivalent states.
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20231024000917.12153-8-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
00808be797
commit
ae5e9c3ced
1 changed files with 4 additions and 0 deletions
|
@ -16540,6 +16540,10 @@ static int is_state_visited(struct bpf_verifier_env *env, int insn_idx)
|
|||
!iter_active_depths_differ(&sl->state, cur)) {
|
||||
verbose_linfo(env, insn_idx, "; ");
|
||||
verbose(env, "infinite loop detected at insn %d\n", insn_idx);
|
||||
verbose(env, "cur state:");
|
||||
print_verifier_state(env, cur->frame[cur->curframe], true);
|
||||
verbose(env, "old state:");
|
||||
print_verifier_state(env, sl->state.frame[cur->curframe], true);
|
||||
return -EINVAL;
|
||||
}
|
||||
/* if the verifier is processing a loop, avoid adding new state
|
||||
|
|
Loading…
Reference in a new issue