Commit 673dde8
bpf: Search and add kfuncs in struct_ops prologue and epilogue
[ Upstream commit d519594 ]
Currently, add_kfunc_call() is only invoked once before the main
verification loop. Therefore, the verifier could not find the
bpf_kfunc_btf_tab of a new kfunc call which is not seen in user defined
struct_ops operators but introduced in gen_prologue or gen_epilogue
during do_misc_fixup(). Fix this by searching kfuncs in the patching
instruction buffer and add them to prog->aux->kfunc_tab.
Signed-off-by: Amery Hung <amery.hung@bytedance.com>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20250225233545.285481-1-ameryhung@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 06100e6 commit 673dde8
1 file changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2987 | 2987 | | |
2988 | 2988 | | |
2989 | 2989 | | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
2990 | 3005 | | |
2991 | 3006 | | |
2992 | 3007 | | |
| |||
19768 | 19783 | | |
19769 | 19784 | | |
19770 | 19785 | | |
19771 | | - | |
| 19786 | + | |
19772 | 19787 | | |
19773 | 19788 | | |
19774 | 19789 | | |
| |||
19797 | 19812 | | |
19798 | 19813 | | |
19799 | 19814 | | |
| 19815 | + | |
| 19816 | + | |
| 19817 | + | |
| 19818 | + | |
19800 | 19819 | | |
19801 | 19820 | | |
19802 | 19821 | | |
| |||
19817 | 19836 | | |
19818 | 19837 | | |
19819 | 19838 | | |
| 19839 | + | |
| 19840 | + | |
| 19841 | + | |
| 19842 | + | |
19820 | 19843 | | |
19821 | 19844 | | |
19822 | 19845 | | |
| |||
0 commit comments