Skip to content

[Deepin-Kernel-SIG] [linux 6.12-y] Fix CVE-2026-46300#1738

Merged
opsiff merged 3 commits into
deepin-community:linux-6.12.yfrom
opsiff:linux-6.12.y-2026-05-16-fix
May 16, 2026
Merged

[Deepin-Kernel-SIG] [linux 6.12-y] Fix CVE-2026-46300#1738
opsiff merged 3 commits into
deepin-community:linux-6.12.yfrom
opsiff:linux-6.12.y-2026-05-16-fix

Conversation

@opsiff
Copy link
Copy Markdown
Member

@opsiff opsiff commented May 16, 2026

No description provided.

opsiff and others added 3 commits May 16, 2026 16:58
…rag-transfer helpers"

This reverts commit 2977587.

Revert the v4 patch to use next v5 patch.

Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
(cherry picked from commit df74f23)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…sfer helpers

maillist inclusion
category: bugfix
CVE: CVE-2026-46300

Two frag-transfer helpers (__pskb_copy_fclone() and skb_shift()) fail
to propagate the SKBFL_SHARED_FRAG bit in skb_shinfo()->flags when
moving frags from source to destination.  __pskb_copy_fclone() defers
the rest of the shinfo metadata to skb_copy_header() after copying
frag descriptors, but that helper only carries over gso_{size,segs,
type} and never touches skb_shinfo()->flags; skb_shift() moves frag
descriptors directly and leaves flags untouched.  As a result, the
destination skb keeps a reference to the same externally-owned or
page-cache-backed pages while reporting skb_has_shared_frag() as
false.

The mismatch is harmful in any in-place writer that uses
skb_has_shared_frag() to decide whether shared pages must be detoured
through skb_cow_data().  ESP input is one such writer (esp4.c,
esp6.c), and a single nft 'dup to <local>' rule -- or any other
nf_dup_ipv4() / xt_TEE caller -- is enough to land a pskb_copy()'d
skb in esp_input() with the marker stripped, letting an unprivileged
user write into the page cache of a root-owned read-only file via
authencesn-ESN stray writes.

Set SKBFL_SHARED_FRAG on the destination whenever frag descriptors
were actually moved from the source.  skb_copy() and skb_copy_expand()
share skb_copy_header() too but linearize all paged data into freshly
allocated head storage and emerge with nr_frags == 0, so
skb_has_shared_frag() returns false on its own; they need no change.

The same omission exists in skb_gro_receive() and skb_gro_receive_list().
The former moves the incoming skb's frag descriptors into the
accumulator's last sub-skb via two paths (a direct frag-move loop and
the head_frag + memcpy path); the latter chains the incoming skb whole
onto p's frag_list.  Downstream skb_segment() reads only
skb_shinfo(p)->flags, and skb_segment_list() reuses each sub-skb's
shinfo as the nskb -- both p and lp must carry the marker.

The same omission also exists in tcp_clone_payload(), which builds an
MTU probe skb by moving frag descriptors from skbs on sk_write_queue
into a freshly allocated nskb.  The helper falls into the same family
and warrants the same fix for consistency; no TCP TX-side in-place
writer is currently known to reach a user page through this gap, but
a future consumer depending on the marker would regress silently.

Fixes: cef401d ("net: fix possible wrong checksum generation")
Fixes: f4c50a4034e6 ("xfrm: esp: avoid in-place decrypt on shared skb frags")
Suggested-by: Sabrina Dubroca <sd@queasysnail.net>
Suggested-by: Sultan Alsawaf <sultan@kerneltoast.com>
Suggested-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Link: https://github.com/v12-security/pocs/tree/main/fragnesia
Link: https://x.com/v12sec/status/2054491454064746629
Link: https://lists.openwall.net/netdev/2026/05/13/79
Link: https://lore.kernel.org/all/20260513041635.1289541-1-vakzz@zellic.io/
Link: https://lore.kernel.org/all/agRfuVOeMI5pbHhY@v4bel/
[ add fix from
https://lore.kernel.org/stable/20260515164121.2608076-1-aaron1esau@gmail.com ]
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
(cherry picked from commit 6dfedcb)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
netdev inclusion
category: bugfix
CVE: CVE-2026-46300

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: cef401d ("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>
(cherry picked from commit f84eca5817390257cef78013d0112481c503b4a3)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
(cherry picked from commit f786284)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @opsiff, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@Avenger-285714
Copy link
Copy Markdown
Member

/approve

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Avenger-285714

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@opsiff opsiff merged commit 7c2c6f2 into deepin-community:linux-6.12.y May 16, 2026
12 of 15 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses CVE-2026-46300 by preserving SKBFL_SHARED_FRAG metadata when skbuff fragments are segmented or coalesced, helping ensure shared fragments are handled safely during checksum processing.

Changes:

  • Propagates shared-fragment state from frag-list sources during skb_segment().
  • Preserves shared-fragment state when skb_try_coalesce() merges paged frags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread net/core/skbuff.c
nfrags = skb_shinfo(list_skb)->nr_frags;
frag = skb_shinfo(list_skb)->frags;
frag_skb = list_skb;
skb_shinfo(nskb)->flags |= skb_shinfo(frag_skb)->flags & SKBFL_SHARED_FRAG;
Comment thread net/core/skbuff.c
nfrags = skb_shinfo(list_skb)->nr_frags;
frag = skb_shinfo(list_skb)->frags;
frag_skb = list_skb;
skb_shinfo(nskb)->flags |= skb_shinfo(frag_skb)->flags & SKBFL_SHARED_FRAG;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants