Re: [PATCH net 1/4] net: skbuff: limit folio refcount when copying skb frag references
From: David Hildenbrand (Arm)
Date: Sun Nov 22 2026 - 07:58:27 EST
>
> [Severity: Low]
> This isn't a bug in mainline, but the refusal described here only works
> because try_get_page() enforces the refcount limit. That check was added
> by commit c6c9a4c1c9a1 ("mm: limit pagecache folio refcount when splicing
> into pipes"), which builds on 26b8f029ce52 ("mm: limit pagecache folio
> refcount when mapping pages").
>
> Before those commits, try_get_page() had no upper bound:
>
> page = compound_head(page);
> if (WARN_ON_ONCE(page_ref_count(page) <= 0))
> return false;
> page_ref_inc(page);
> return true;
>
> This patch has Cc: stable and Fixes tags back to 800d8c63b2e9. A backport
> to a tree without the prerequisites would still compile. There,
> skb_frag_try_ref() would never refuse a reference and would only warn
> after the refcount has wrapped.
>
> Could the commit message state this dependency, for example with a
> "# depends on" note on the stable tag?
No.
[...]
> [Severity: High]
> Can this make the converted paths fail on every packet for drivers that
> deliberately keep RX page refcounts near INT_MAX?
>
> Every frag that is neither page_pool nor net_iov now goes through
> try_get_page()->folio_get_checked()->__folio_ref_count_over_limit(). That
> check applies to any folio, not just pagecache folios.
>
> The gve driver uses GQI RDA/QPL and DQO-QPL, and none of these use
> page_pool. It biases its RX pages up to INT_MAX:
>
> drivers/net/ethernet/google/gve/gve_rx.c:gve_setup_rx_buffer() {
> ...
> /* The page already has 1 ref */
> page_ref_add(page, INT_MAX - 1);
> page_info->pagecnt_bias = INT_MAX;
> }
CCing the person that introduced this refcount abuse, making me angry on a Sunday.
Fix your goddamn drivers, that's just an abuse of the page refcount scheme and I
won't hack around that.
--
Cheers,
David