* FAILED: patch "[PATCH] net: skbuff: preserve shared-frag marker during coalescing" failed to apply to 5.10-stable tree
@ 2026-05-22 9:26 gregkh
2026-05-22 20:09 ` [PATCH 5.10] net: skbuff: preserve shared-frag marker during coalescing Ben Hutchings
0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2026-05-22 9:26 UTC (permalink / raw)
To: vakzz, edumazet, jiayuan.chen, kuba; +Cc: stable
The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x f84eca5817390257cef78013d0112481c503b4a3
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026052258-glamorous-basically-d5e2@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From f84eca5817390257cef78013d0112481c503b4a3 Mon Sep 17 00:00:00 2001
From: William Bowling <vakzz@zellic.io>
Date: Wed, 13 May 2026 04:16:35 +0000
Subject: [PATCH] net: skbuff: preserve shared-frag marker during coalescing
skb_try_coalesce() can attach paged frags from @from to @to. If @from
has SKBFL_SHARED_FRAG set, the resulting @to skb can contain the same
externally-owned or page-cache-backed frags, but the shared-frag marker
is currently lost.
That breaks the invariant relied on by later in-place writers. In
particular, ESP input checks skb_has_shared_frag() before deciding
whether an uncloned nonlinear skb can skip skb_cow_data(). If TCP
receive coalescing has moved shared frags into an unmarked skb, ESP can
see skb_has_shared_frag() as false and decrypt in place over page-cache
backed frags.
Propagate SKBFL_SHARED_FRAG when skb_try_coalesce() transfers paged
frags. The tailroom copy path does not need the marker because it copies
bytes into @to's linear data rather than transferring frag descriptors.
Fixes: cef401de7be8 ("net: fix possible wrong checksum generation")
Fixes: f4c50a4034e6 ("xfrm: esp: avoid in-place decrypt on shared skb frags")
Signed-off-by: William Bowling <vakzz@zellic.io>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Tested-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://patch.msgid.link/20260513041635.1289541-1-vakzz@zellic.io
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 7dad68e3b518..9c4e8d331d6d 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -6200,6 +6200,8 @@ bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,
from_shinfo->frags,
from_shinfo->nr_frags * sizeof(skb_frag_t));
to_shinfo->nr_frags += from_shinfo->nr_frags;
+ if (from_shinfo->nr_frags)
+ to_shinfo->flags |= from_shinfo->flags & SKBFL_SHARED_FRAG;
if (!skb_cloned(from))
from_shinfo->nr_frags = 0;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 5.10] net: skbuff: preserve shared-frag marker during coalescing
2026-05-22 9:26 FAILED: patch "[PATCH] net: skbuff: preserve shared-frag marker during coalescing" failed to apply to 5.10-stable tree gregkh
@ 2026-05-22 20:09 ` Ben Hutchings
2026-05-23 6:07 ` Harshit Mogalapalli
0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2026-05-22 20:09 UTC (permalink / raw)
To: gregkh; +Cc: vakzz, edumazet, jiayuan.chen, kuba, stable
[-- Attachment #1: Type: text/plain, Size: 2117 bytes --]
From: William Bowling <vakzz@zellic.io>
commit f84eca5817390257cef78013d0112481c503b4a3 upstream.
skb_try_coalesce() can attach paged frags from @from to @to. If @from
has SKBFL_SHARED_FRAG set, the resulting @to skb can contain the same
externally-owned or page-cache-backed frags, but the shared-frag marker
is currently lost.
That breaks the invariant relied on by later in-place writers. In
particular, ESP input checks skb_has_shared_frag() before deciding
whether an uncloned nonlinear skb can skip skb_cow_data(). If TCP
receive coalescing has moved shared frags into an unmarked skb, ESP can
see skb_has_shared_frag() as false and decrypt in place over page-cache
backed frags.
Propagate SKBFL_SHARED_FRAG when skb_try_coalesce() transfers paged
frags. The tailroom copy path does not need the marker because it copies
bytes into @to's linear data rather than transferring frag descriptors.
Fixes: cef401de7be8 ("net: fix possible wrong checksum generation")
Fixes: f4c50a4034e6 ("xfrm: esp: avoid in-place decrypt on shared skb frags")
Signed-off-by: William Bowling <vakzz@zellic.io>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Tested-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://patch.msgid.link/20260513041635.1289541-1-vakzz@zellic.io
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[bwh: Backported to 5.10: Set the SKBTX_SHARED_FRAG flag in
sk_buff::tx_flags, instead of SKBFL_SHARED_FRAG in sk_buff::flags]
Signed-off-by: Ben Hutchings <benh@debian.org>
---
net/core/skbuff.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 297a2efd6322..c195107434b8 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -5315,6 +5315,8 @@ bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,
from_shinfo->frags,
from_shinfo->nr_frags * sizeof(skb_frag_t));
to_shinfo->nr_frags += from_shinfo->nr_frags;
+ if (from_shinfo->nr_frags)
+ to_shinfo->tx_flags |= from_shinfo->tx_flags & SKBTX_SHARED_FRAG;
if (!skb_cloned(from))
from_shinfo->nr_frags = 0;
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 5.10] net: skbuff: preserve shared-frag marker during coalescing
2026-05-22 20:09 ` [PATCH 5.10] net: skbuff: preserve shared-frag marker during coalescing Ben Hutchings
@ 2026-05-23 6:07 ` Harshit Mogalapalli
0 siblings, 0 replies; 3+ messages in thread
From: Harshit Mogalapalli @ 2026-05-23 6:07 UTC (permalink / raw)
To: Ben Hutchings, gregkh; +Cc: vakzz, edumazet, jiayuan.chen, kuba, stable
On 23/05/26 01:39, Ben Hutchings wrote:
> From: William Bowling <vakzz@zellic.io>
>
> commit f84eca5817390257cef78013d0112481c503b4a3 upstream.
>
> skb_try_coalesce() can attach paged frags from @from to @to. If @from
> has SKBFL_SHARED_FRAG set, the resulting @to skb can contain the same
> externally-owned or page-cache-backed frags, but the shared-frag marker
> is currently lost.
>
> That breaks the invariant relied on by later in-place writers. In
> particular, ESP input checks skb_has_shared_frag() before deciding
> whether an uncloned nonlinear skb can skip skb_cow_data(). If TCP
> receive coalescing has moved shared frags into an unmarked skb, ESP can
> see skb_has_shared_frag() as false and decrypt in place over page-cache
> backed frags.
>
> Propagate SKBFL_SHARED_FRAG when skb_try_coalesce() transfers paged
> frags. The tailroom copy path does not need the marker because it copies
> bytes into @to's linear data rather than transferring frag descriptors.
>
> Fixes: cef401de7be8 ("net: fix possible wrong checksum generation")
> Fixes: f4c50a4034e6 ("xfrm: esp: avoid in-place decrypt on shared skb frags")
> Signed-off-by: William Bowling <vakzz@zellic.io>
> Reviewed-by: Eric Dumazet <edumazet@google.com>
> Tested-by: Jiayuan Chen <jiayuan.chen@linux.dev>
> Link: https://patch.msgid.link/20260513041635.1289541-1-vakzz@zellic.io
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> [bwh: Backported to 5.10: Set the SKBTX_SHARED_FRAG flag in
> sk_buff::tx_flags, instead of SKBFL_SHARED_FRAG in sk_buff::flags]
right! due to missing commit: 06b4feb37e64 ("net: group skb_shinfo
zerocopy related bits together.") in 5.10.y it is only in 5.12+
Note: I did the same for downstream UEK(OL) trees and was planning to
submit them here. Given that you posted them before I did, sending my
acknowledgements.
LGTM from a backport point of view.
Reviewed-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
thanks,
Harshit
> Signed-off-by: Ben Hutchings <benh@debian.org>
> ---
> net/core/skbuff.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 297a2efd6322..c195107434b8 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -5315,6 +5315,8 @@ bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,
> from_shinfo->frags,
> from_shinfo->nr_frags * sizeof(skb_frag_t));
> to_shinfo->nr_frags += from_shinfo->nr_frags;
> + if (from_shinfo->nr_frags)
> + to_shinfo->tx_flags |= from_shinfo->tx_flags & SKBTX_SHARED_FRAG;
>
> if (!skb_cloned(from))
> from_shinfo->nr_frags = 0;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-23 6:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-22 9:26 FAILED: patch "[PATCH] net: skbuff: preserve shared-frag marker during coalescing" failed to apply to 5.10-stable tree gregkh
2026-05-22 20:09 ` [PATCH 5.10] net: skbuff: preserve shared-frag marker during coalescing Ben Hutchings
2026-05-23 6:07 ` Harshit Mogalapalli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox