From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: sashiko-reviews@lists.linux.dev
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf] bpf: free page_pool frags via the page_pool path in bpf_xdp_shrink_data
Date: Sun, 16 Aug 2026 13:10:56 +0800 [thread overview]
Message-ID: <8cbc09e6-bc32-46d7-bdb6-890a3ba59568@linux.dev> (raw)
In-Reply-To: <20260816033752.794AE1F000E9@smtp.kernel.org>
On 8/16/26 11:37 AM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> - [High] The netmem_is_pp() check fails on compound tail pages, leading to page_pool leaks and 'Bad page state' kernel panics.
> - [Low] The multi-line comment introduced in bpf_xdp_shrink_data() does not follow the required BPF subsystem comment style.
> --
>
> --- Patch [1]: [PATCH bpf] bpf: free page_pool frags via the page_pool path in bpf_xdp_shrink_data ---
> commit 28e0b86b119236ed1263628b895946efb16e99cf
> Author: Jiayuan Chen <jiayuan.chen@linux.dev>
>
> bpf: free page_pool frags via the page_pool path in bpf_xdp_shrink_data
>
> This commit fixes a page_pool leak reported by syzbot when generic XDP
> programs shrink skbs into fragments. It inspects the page itself using
> netmem_is_pp() rather than relying on the rxq memory model.
>
> Closes: https://syzkaller.appspot.com/bug?extid=237bbeed8dfe0699b7f5
>
>> diff --git a/net/core/filter.c b/net/core/filter.c
>> index 3423734124a5b..4536bd147c253 100644
>> --- a/net/core/filter.c
>> +++ b/net/core/filter.c
> [ ... ]
>
>> @@ -4293,6 +4294,14 @@ static bool bpf_xdp_shrink_data(struct xdp_buff *xdp, skb_frag_t *frag,
>> if (mem_type == MEM_TYPE_XSK_BUFF_POOL) {
>> netmem = 0;
>> zc_frag = bpf_xdp_shrink_data_zc(xdp, shrink, tail, release);
>> + } else if (netmem_is_pp(netmem)) {
> [Severity: High]
> Does this check handle compound tail pages correctly?
I think we should process it like napi_pp_put_page
...
} else if (netmem_is_pp(netmem_compound_head(netmem))) {
mem_type = MEM_TYPE_PAGE_POOL;
}
next prev parent reply other threads:[~2026-08-16 5:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-16 3:12 [PATCH bpf] bpf: free page_pool frags via the page_pool path in bpf_xdp_shrink_data Jiayuan Chen
2026-08-16 3:37 ` sashiko-bot
2026-08-16 5:10 ` Jiayuan Chen [this message]
2026-08-16 3:57 ` bot+bpf-ci
2026-08-16 5:16 ` Jiayuan Chen
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=8cbc09e6-bc32-46d7-bdb6-890a3ba59568@linux.dev \
--to=jiayuan.chen@linux.dev \
--cc=bpf@vger.kernel.org \
--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.