bpf: Fix memory leak in bpf_core_apply
Jiri Olsa
reviewerPATCH 1/1 bpf: Fix memory leak in bpf_core_apply
We need to free specs properly.
Cc Eduard Zingerman <[email protected]>
Fixes 3d2786d65aaa ("bpf: correctly handle malformed BPF_CORE_TYPE_ID_LOCAL relos")
Signed-off-by Jiri Olsa <[email protected]>
--- kernel/bpf/btf.c | 1 + 1 file changed, 1 insertion(+)
kernel/bpf/btf.c +1 -0
@@ -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 ; }
Signature · 1 line
2.46.2
Quoted 6 lines · Jiri Olsa
We need to free specs properly.
Cc Eduard Zingerman <[email protected]>Fixes 3d2786d65aaa ("bpf: correctly handle malformed BPF_CORE_TYPE_ID_LOCAL relos")Signed-off-by Jiri Olsa <[email protected]>---
Acked-by Eduard Zingerman <[email protected]>
This patch was applied to bpf/bpf.git (master) by Andrii Nakryiko <[email protected]>:
Hello:
This patch was applied to bpf/bpf.git (master)
by Andrii Nakryiko <[email protected]>:
Quoted 8 lines · On Mon, 7 Oct 2024 18:09:58 +0200 you wrote:
We need to free specs properly.
Cc Eduard Zingerman <[email protected]>Fixes 3d2786d65aaa ("bpf: correctly handle malformed BPF_CORE_TYPE_ID_LOCAL relos")Signed-off-by Jiri Olsa <[email protected]>--- 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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html