Skip to content

Commit ceb1167

Browse files
Yinjun Zhangborkmann
authored andcommitted
bpf, offload: Reorder offload callback 'prepare' in verifier
Commit 4976b71 ("bpf: Introduce pseudo_btf_id") switched the order of resolve_pseudo_ldimm(), in which some pseudo instructions are rewritten. Thus those rewritten instructions cannot be passed to driver via 'prepare' offload callback. Reorder the 'prepare' offload callback to fix it. Fixes: 4976b71 ("bpf: Introduce pseudo_btf_id") Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Song Liu <songliubraving@fb.com> Link: https://lore.kernel.org/bpf/20210520085834.15023-1-simon.horman@netronome.com
1 parent 0af02eb commit ceb1167

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎kernel/bpf/verifier.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13368,12 +13368,6 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr,
1336813368
if (is_priv)
1336913369
env->test_state_freq = attr->prog_flags & BPF_F_TEST_STATE_FREQ;
1337013370

13371-
if (bpf_prog_is_dev_bound(env->prog->aux)) {
13372-
ret = bpf_prog_offload_verifier_prep(env->prog);
13373-
if (ret)
13374-
goto skip_full_check;
13375-
}
13376-
1337713371
env->explored_states = kvcalloc(state_htab_size(env),
1337813372
sizeof(struct bpf_verifier_state_list *),
1337913373
GFP_USER);
@@ -13401,6 +13395,12 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr,
1340113395
if (ret < 0)
1340213396
goto skip_full_check;
1340313397

13398+
if (bpf_prog_is_dev_bound(env->prog->aux)) {
13399+
ret = bpf_prog_offload_verifier_prep(env->prog);
13400+
if (ret)
13401+
goto skip_full_check;
13402+
}
13403+
1340413404
ret = check_cfg(env);
1340513405
if (ret < 0)
1340613406
goto skip_full_check;

0 commit comments

Comments
 (0)