linux-next: manual merge of the net-next tree with the net tree

From: Mark Brown

Date: Tue Dec 01 2026 - 09:23:15 EST


Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

net/core/skbuff.c

between commits:

c4c0e59c6b75b ("net: skbuff: limit folio refcount when rearranging skb frags")
ee5c8fcd02634 ("net: skbuff: limit folio refcount when copying skb frag references")

from the net tree and commits:

b242a00c2bc3b ("net: skbuff: make skb_try_coalesce()'s len unsigned")
86cc1a8a942b1 ("net: skbuff: let skb_zerocopy() copy a short skb without head_frag")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc net/core/skbuff.c
index 6c496e881b3df,4a47ee762cd0e..0000000000000
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@@ -3919,10 -4173,11 +4184,12 @@@ EXPORT_SYMBOL_GPL(skb_zerocopy_headlen)
*
* Return value:
* 0: everything is OK
- * -ENOMEM: couldn't orphan frags of @from due to lack of memory
+ * -ENOMEM: couldn't orphan frags of @from due to lack of memory, or
+ * couldn't take additional references to the frags of @from
- * -EFAULT: skb_copy_bits() found some problem with skb geometry, or readable head
- * payload would be mixed with unreadable frags.
+ * -EFAULT: skb_copy_bits() found some problem with skb geometry, @from has
+ * no head_frag and @hlen is 0 while @len doesn't fit in @to's tailroom,
+ * or readable head payload would be mixed with unreadable frags.
+ * -EINVAL: @len or @hlen is negative
*/
int
skb_zerocopy(struct sk_buff *to, struct sk_buff *from, int len, int hlen)
@@@ -6324,8 -6612,8 +6639,9 @@@ bool skb_try_coalesce(struct sk_buff *t
bool *fragstolen, int *delta_truesize)
{
struct skb_shared_info *to_shinfo, *from_shinfo;
- int delta, len = from->len;
+ unsigned int len = from->len;
- int i, delta;
+ bool cloned;
++ int delta;

*fragstolen = false;

@@@ -6396,17 -6674,20 +6702,29 @@@
delta = from->truesize - SKB_TRUESIZE(skb_end_offset(from));
}

- WARN_ON_ONCE(delta < len);
+ /* @from claims more data than it has memory for. Leave @to alone. */
+ if (WARN_ON_ONCE(delta < 0 || delta < len))
+ return false;
+
+ if (skb_headlen(from) != 0) {
+ struct page *page = virt_to_head_page(from->head);
+ unsigned int offset;
+
+ offset = from->data - (unsigned char *)page_address(page);
+ skb_fill_page_desc(to, to_shinfo->nr_frags,
+ page, offset, skb_headlen(from));
+ *fragstolen = true;
+ }

+ /*
+ * A clone keeps referencing its frags, so we need our own references.
+ * Nothing was added to @to yet: we only steal the head of @from above
+ * if it is not locked, and the head of a clone is always locked.
+ */
+ cloned = skb_cloned(from);
+ if (cloned && !skb_frags_try_ref(from))
+ return false;
+
memcpy(to_shinfo->frags + to_shinfo->nr_frags,
from_shinfo->frags,
from_shinfo->nr_frags * sizeof(skb_frag_t));

Attachment: signature.asc
Description: PGP signature