From: sashiko-bot@kernel.org
To: "Pu Lehui" <pulehui@huaweicloud.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v2 3/7] parisc: Fix memory leak in bpf_jit_free
Date: Sat, 25 Jul 2026 10:28:03 +0000 [thread overview]
Message-ID: <20260725102804.3385E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260725102020.2287770-4-pulehui@huaweicloud.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The patch introduces a build failure due to the use of an incomplete type (`struct bpf_jit_data`) and an undeclared static inline function (`bpf_jit_binary_hdr`).
--
--- Patch [3]: [PATCH bpf-next v2 3/7] parisc: Fix memory leak in bpf_jit_free ---
commit 8b0b5655843da846b247fa021046070e5875f56c
Author: Pu Lehui <pulehui@huawei.com>
parisc: Fix memory leak in bpf_jit_free
This commit implements a custom bpf_jit_free() for the parisc architecture
to free leftover JIT data when a subprogram fails to JIT.
> diff --git a/arch/parisc/net/bpf_jit_core.c b/arch/parisc/net/bpf_jit_core.c
> index 172770132440d..11e13ad6bc509 100644
> --- a/arch/parisc/net/bpf_jit_core.c
> +++ b/arch/parisc/net/bpf_jit_core.c
> @@ -178,6 +178,25 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_pr
> goto out_offset;
> }
>
> +void bpf_jit_free(struct bpf_prog *fp)
> +{
> + if (fp->jited) {
> + struct bpf_jit_data *jit_data = fp->aux->jit_data;
> + struct bpf_binary_header *hdr = bpf_jit_binary_hdr(fp);
> +
> + /* Cleanup for earlier subprogs if jit_subprogs() aborts */
> + if (jit_data) {
> + kfree(jit_data->ctx.offset);
[Severity: Low]
Will this cause a build failure on parisc?
It looks like struct bpf_jit_data is an incomplete type not defined anywhere
in the kernel, and the correct type used elsewhere in this file is struct
hppa_jit_data.
Additionally, is it possible to call bpf_jit_binary_hdr() here? It appears
to be a static inline function local to kernel/bpf/core.c and is not exported.
> + kfree(jit_data);
> + }
> +
> + bpf_jit_binary_free(hdr);
> + WARN_ON_ONCE(!bpf_prog_kallsyms_verify_off(fp));
> + }
> +
> + bpf_prog_unlock_free(fp);
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260725102020.2287770-1-pulehui@huaweicloud.com?part=3
next prev parent reply other threads:[~2026-07-25 10:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 10:20 [PATCH bpf-next v2 0/7] Fixes for bpf_jit_free Pu Lehui
2026-07-25 10:20 ` [PATCH bpf-next v2 1/7] bpf, arm64: Fix memory leak in bpf_jit_free Pu Lehui
2026-07-25 10:31 ` sashiko-bot
2026-07-25 10:20 ` [PATCH bpf-next v2 2/7] s390/bpf: " Pu Lehui
2026-07-25 10:27 ` sashiko-bot
2026-07-25 10:20 ` [PATCH bpf-next v2 3/7] parisc: " Pu Lehui
2026-07-25 10:28 ` sashiko-bot [this message]
2026-07-25 10:20 ` [PATCH bpf-next v2 4/7] bpf, sparc64: " Pu Lehui
2026-07-25 10:29 ` sashiko-bot
2026-07-25 10:20 ` [PATCH bpf-next v2 5/7] ARC, bpf: " Pu Lehui
2026-07-25 10:29 ` sashiko-bot
2026-07-25 10:20 ` [PATCH bpf-next v2 6/7] riscv, bpf: Adjust bpf_func to account for CFI offset " Pu Lehui
2026-07-25 10:27 ` sashiko-bot
2026-07-25 10:20 ` [PATCH bpf-next v2 7/7] bpf: Fix double-free RO header " Pu Lehui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260725102804.3385E1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=pulehui@huaweicloud.com \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.