bpf, arm64: Call bpf_jit_binary_pack_finalize() in bpf_jit_free()
Subsystems (3)
PATCH 1/1 bpf, arm64: Call bpf_jit_binary_pack_finalize() in bpf_jit_free()
The current implementation seems incorrect and does NOT match the comment above, use bpf_jit_binary_pack_finalize() instead.
--- arch/arm64/net/bpf_jit_comp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm64/net/bpf_jit_comp.c +1 -2
@@ -3064,8 +3064,7 @@ void bpf_jit_free(struct bpf_prog *prog)* before freeing it. */ if (jit_data) { -bpf_arch_text_copy (&jit_data->ro_header->size, &jit_data->header->size, -sizeof (jit_data->header->size)); +bpf_jit_binary_pack_finalize (jit_data->ro_header, jit_data->header);kfree (jit_data); } prog->bpf_func -=cfi_get_offset ();
Signature · 1 line
2.27.0
Quoted 7 lines · Hengqi Chen
The current implementation seems incorrect and does NOT match the comment above, use
bpf_jit_binary_pack_finalize()instead.Fixes 1dad391daef1 ("bpf, arm64: use bpf_prog_pack for memory management")Acked-by Puranjay Mohan <[email protected]>Signed-off-by Hengqi Chen <[email protected]>
Thanks for the fix!
Quoted 26 lines · Hengqi Chen
The current implementation seems incorrect and does NOT match the comment above, use
bpf_jit_binary_pack_finalize()instead.Fixes 1dad391daef1 ("bpf, arm64: use bpf_prog_pack for memory management")Acked-by Puranjay Mohan <[email protected]>Signed-off-by Hengqi Chen <[email protected]>--- arch/arm64/net/bpf_jit_comp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)arch/arm64/net/bpf_jit_comp.c +1
-2@@ -3064,8 +3064,7 @@ void bpf_jit_free(struct bpf_prog *prog)* before freeing it. */ if (jit_data) { -bpf_arch_text_copy (&jit_data->ro_header->size, &jit_data->header->size, -sizeof (jit_data->header->size)); +bpf_jit_binary_pack_finalize (jit_data->ro_header, jit_data->header);kfree (jit_data); } prog->bpf_func -=cfi_get_offset ();Signature · 1 line
2.27.0
Thanks,
Puranjay
This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:
Quoted 8 lines · On Tue, 16 Sep 2025 23:26:53 +0000 you wrote:
The current implementation seems incorrect and does NOT match the comment above, use
bpf_jit_binary_pack_finalize()instead.Fixes 1dad391daef1 ("bpf, arm64: use bpf_prog_pack for memory management")Acked-by Puranjay Mohan <[email protected]>Signed-off-by Hengqi Chen <[email protected]>[...]
Here is the summary with links:
- [bpf-next] bpf, arm64: Call bpf_jit_binary_pack_finalize() in bpf_jit_free()
https://git.kernel.org/bpf/bpf-next/c/6ff4a0fa3e1b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html