* [PATCH bpf] bpf: Fix memory leak in bpf_core_apply
@ 2024-10-07 16:09 Jiri Olsa
2024-10-07 17:13 ` Eduard Zingerman
2024-10-08 3:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Jiri Olsa @ 2024-10-07 16:09 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
Cc: Eduard Zingerman, bpf, Martin KaFai Lau, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo
We need to free specs properly.
Cc: Eduard Zingerman <eddyz87@gmail.com>
Fixes: 3d2786d65aaa ("bpf: correctly handle malformed BPF_CORE_TYPE_ID_LOCAL relos")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
kernel/bpf/btf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 75e4fe83c509..a05da5f43547 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -8961,6 +8961,7 @@ int bpf_core_apply(struct bpf_core_ctx *ctx, const struct bpf_core_relo *relo,
if (!type) {
bpf_log(ctx->log, "relo #%u: bad type id %u\n",
relo_idx, relo->type_id);
+ kfree(specs);
return -EINVAL;
}
--
2.46.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH bpf] bpf: Fix memory leak in bpf_core_apply
2024-10-07 16:09 [PATCH bpf] bpf: Fix memory leak in bpf_core_apply Jiri Olsa
@ 2024-10-07 17:13 ` Eduard Zingerman
2024-10-08 3:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Eduard Zingerman @ 2024-10-07 17:13 UTC (permalink / raw)
To: Jiri Olsa, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
Cc: bpf, Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo
On Mon, 2024-10-07 at 18:09 +0200, Jiri Olsa wrote:
> We need to free specs properly.
>
> Cc: Eduard Zingerman <eddyz87@gmail.com>
> Fixes: 3d2786d65aaa ("bpf: correctly handle malformed BPF_CORE_TYPE_ID_LOCAL relos")
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH bpf] bpf: Fix memory leak in bpf_core_apply
2024-10-07 16:09 [PATCH bpf] bpf: Fix memory leak in bpf_core_apply Jiri Olsa
2024-10-07 17:13 ` Eduard Zingerman
@ 2024-10-08 3:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-10-08 3:30 UTC (permalink / raw)
To: Jiri Olsa
Cc: ast, daniel, andrii, eddyz87, bpf, kafai, songliubraving, yhs,
john.fastabend, kpsingh, sdf, haoluo
Hello:
This patch was applied to bpf/bpf.git (master)
by Andrii Nakryiko <andrii@kernel.org>:
On Mon, 7 Oct 2024 18:09:58 +0200 you wrote:
> We need to free specs properly.
>
> Cc: Eduard Zingerman <eddyz87@gmail.com>
> Fixes: 3d2786d65aaa ("bpf: correctly handle malformed BPF_CORE_TYPE_ID_LOCAL relos")
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
> kernel/bpf/btf.c | 1 +
> 1 file changed, 1 insertion(+)
Here is the summary with links:
- [bpf] bpf: Fix memory leak in bpf_core_apply
https://git.kernel.org/bpf/bpf/c/45126b155e3b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-08 3:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-07 16:09 [PATCH bpf] bpf: Fix memory leak in bpf_core_apply Jiri Olsa
2024-10-07 17:13 ` Eduard Zingerman
2024-10-08 3:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox