mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 02:53:36 +02:00
bpf: abort verification if env->cur_state->loop_entry != NULL
In addition to warning abort verification with -EFAULT.
If env->cur_state->loop_entry != NULL something is irrecoverably
buggy.
Fixes: bbbc02b744 ("bpf: copy_verifier_state() should copy 'loop_entry' field")
Suggested-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20250225003838.135319-1-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
1ffe30efd2
commit
f3c2d243a3
|
|
@ -19340,8 +19340,10 @@ static int do_check(struct bpf_verifier_env *env)
|
|||
return err;
|
||||
break;
|
||||
} else {
|
||||
if (WARN_ON_ONCE(env->cur_state->loop_entry))
|
||||
env->cur_state->loop_entry = NULL;
|
||||
if (WARN_ON_ONCE(env->cur_state->loop_entry)) {
|
||||
verbose(env, "verifier bug: env->cur_state->loop_entry != NULL\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
do_print_state = true;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user