mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 17:41:50 +00:00
bpf: Cleanup ftrace hash in bpf_trampoline_put
We need to release possible hash from trampoline fops object
before removing it, otherwise we leak it.
Fixes: 00963a2e75
("bpf: Support bpf_trampoline on functions with IPMODIFY (e.g. livepatch)")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/bpf/20220802135651.1794015-1-jolsa@kernel.org
This commit is contained in:
parent
e2dcac2f58
commit
62d468e5e1
1 changed files with 4 additions and 1 deletions
|
@ -841,7 +841,10 @@ void bpf_trampoline_put(struct bpf_trampoline *tr)
|
||||||
* multiple rcu callbacks.
|
* multiple rcu callbacks.
|
||||||
*/
|
*/
|
||||||
hlist_del(&tr->hlist);
|
hlist_del(&tr->hlist);
|
||||||
kfree(tr->fops);
|
if (tr->fops) {
|
||||||
|
ftrace_free_filter(tr->fops);
|
||||||
|
kfree(tr->fops);
|
||||||
|
}
|
||||||
kfree(tr);
|
kfree(tr);
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&trampoline_mutex);
|
mutex_unlock(&trampoline_mutex);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue