diff options
| author | Cupertino Miranda <[email protected]> | 2024-05-06 14:18:44 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2024-05-07 00:09:11 +0000 |
| commit | d786957ebd3fb4cfd9147dbcccd1e8f3871b45ce (patch) | |
| tree | 8248921c59a99bdf7bfac780f92ea5c1246da626 /tools/testing/selftests/bpf/prog_tests/autoload.c | |
| parent | bpftool, selftests/hid/bpf: Fix 29 clang warnings (diff) | |
| download | kernel-d786957ebd3fb4cfd9147dbcccd1e8f3871b45ce.tar.gz kernel-d786957ebd3fb4cfd9147dbcccd1e8f3871b45ce.zip | |
bpf/verifier: replace calls to mark_reg_unknown.
In order to further simplify the code in adjust_scalar_min_max_vals all
the calls to mark_reg_unknown are replaced by __mark_reg_unknown.
static void mark_reg_unknown(struct bpf_verifier_env *env,
struct bpf_reg_state *regs, u32 regno)
{
if (WARN_ON(regno >= MAX_BPF_REG)) {
... mark all regs not init ...
return;
}
__mark_reg_unknown(env, regs + regno);
}
The 'regno >= MAX_BPF_REG' does not apply to
adjust_scalar_min_max_vals(), because it is only called from the
following stack:
- check_alu_op
- adjust_reg_min_max_vals
- adjust_scalar_min_max_vals
The check_alu_op() does check_reg_arg() which verifies that both src and
dst register numbers are within bounds.
Signed-off-by: Cupertino Miranda <[email protected]>
Acked-by: Eduard Zingerman <[email protected]>
Cc: Yonghong Song <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: David Faust <[email protected]>
Cc: Jose Marchesi <[email protected]>
Cc: Elena Zannoni <[email protected]>
Cc: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions
