mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
bpf: enforce precision of R0 on program/async callback return
Given we enforce a valid range for program and async callback return
value, we must mark R0 as precise to avoid incorrect state pruning.
Fixes: b5dc0163d8 ("bpf: precise scalar_value tracking")
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20231202175705.885270-9-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
0ef24c8dfa
commit
eabe518de5
|
|
@ -15138,6 +15138,10 @@ static int check_return_code(struct bpf_verifier_env *env, int regno, const char
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
err = mark_chain_precision(env, regno);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (!retval_range_within(range, reg)) {
|
||||
verbose_invalid_scalar(env, reg, range, exit_ctx, reg_name);
|
||||
if (!is_subprog &&
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user