🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Mark Brown Tue, 01 Dec 2026 14:23
linux-next: manual merge of the net-next tree with the net tree
#25334
Author: Mark Brown
Date: Tue, 01 Dec 2026 14:23
117 lines
11564 bytes
--YXDlHgnfK38Qb6hC
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 fr=
ags")
  ee5c8fcd02634 ("net: skbuff: limit folio refcount when copying skb frag r=
eferences")

=66rom 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")

=66rom 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 read=
able head
-  *      payload would be mixed with unreadable frags.
+  *	-EFAULT: skb_copy_bits() found some problem with skb geometry, @from h=
as
+  *	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 =3D from->len;
+ 	unsigned int len =3D from->len;
 -	int i, delta;
 +	bool cloned;
++	int delta;
 =20
  	*fragstolen =3D false;
 =20
@@@ -6396,17 -6674,20 +6702,29 @@@
  		delta =3D from->truesize - SKB_TRUESIZE(skb_end_offset(from));
  	}
 =20
- 	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;
+=20
+ 	if (skb_headlen(from) !=3D 0) {
+ 		struct page *page =3D virt_to_head_page(from->head);
+ 		unsigned int offset;
+=20
+ 		offset =3D from->data - (unsigned char *)page_address(page);
+ 		skb_fill_page_desc(to, to_shinfo->nr_frags,
+ 				   page, offset, skb_headlen(from));
+ 		*fragstolen =3D true;
+ 	}
 =20
 +	/*
 +	 * 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 =3D 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));

--YXDlHgnfK38Qb6hC
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmsO2EYACgkQJNaLcl1U
h9CWFgf9G/aBoDxRvwF4aaoKQIHOFeazAwgi2tq7BrYZo/brUywRRCWcWJQtPOql
i2wppTLfr5/gJPKrrOwOUzw8aGUkzCfMVSRvCKdaoU8OrUfU4dKFUO82fKFgvoU/
tq8ocUBKA414t+NCiH3bERKxLgMpJD1gBpRh+Et1eXlazvDDZ132Q3piPXUG3egH
3GdRvfqVxRJkJXpZ+5/PrDjLQnlzeiLgw85cPQZxqyEniIqOQP3suQHo0pUrPjSE
vQ4M9JUpaczOp9/fmeT3c6rD4Eftejl4M5QSJses5AGKn2TOlkQ7q+Ln6BzIe0MF
rtzxvH0IEQCM+K44hKJHqg3ggvRHdw==
=QGmw
-----END PGP SIGNATURE-----

--YXDlHgnfK38Qb6hC--
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads