Skip to content

Commit 9c7c48d

Browse files
Alexei Starovoitovanakryiko
authored andcommitted
bpf: Fix subprog names in stack traces.
The commit 7337224 ("bpf: Improve the info.func_info and info.func_info_rec_size behavior") accidently made bpf_prog_ksym_set_name() conservative for bpf subprograms. Fixed it so instead of "bpf_prog_tag_F" the stack traces print "bpf_prog_tag_full_subprog_name". Fixes: 7337224 ("bpf: Improve the info.func_info and info.func_info_rec_size behavior") Reported-by: Tejun Heo <tj@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Martin KaFai Lau <kafai@fb.com> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20220714211637.17150-1-alexei.starovoitov@gmail.com
1 parent 7fb27a5 commit 9c7c48d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

kernel/bpf/verifier.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13631,6 +13631,7 @@ static int jit_subprogs(struct bpf_verifier_env *env)
1363113631
/* Below members will be freed only at prog->aux */
1363213632
func[i]->aux->btf = prog->aux->btf;
1363313633
func[i]->aux->func_info = prog->aux->func_info;
13634+
func[i]->aux->func_info_cnt = prog->aux->func_info_cnt;
1363413635
func[i]->aux->poke_tab = prog->aux->poke_tab;
1363513636
func[i]->aux->size_poke_tab = prog->aux->size_poke_tab;
1363613637

@@ -13643,9 +13644,6 @@ static int jit_subprogs(struct bpf_verifier_env *env)
1364313644
poke->aux = func[i]->aux;
1364413645
}
1364513646

13646-
/* Use bpf_prog_F_tag to indicate functions in stack traces.
13647-
* Long term would need debug info to populate names
13648-
*/
1364913647
func[i]->aux->name[0] = 'F';
1365013648
func[i]->aux->stack_depth = env->subprog_info[i].stack_depth;
1365113649
func[i]->jit_requested = 1;

0 commit comments

Comments
 (0)