Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions SPECS/kernel/0002-net-gro-don-t-merge-zcopy-skbs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From 4db79a322db8c97f7b73b8a347395ef4d685eb40 Mon Sep 17 00:00:00 2001
From: Sabrina Dubroca <sd@queasysnail.net>
Date: Wed, 20 May 2026 22:44:42 +0200
Subject: [PATCH] net: gro: don't merge zcopy skbs

skb_gro_receive() can currently copy frags between the source and GRO
skb, without checking the zerocopy status, and in particular the
SKBFL_MANAGED_FRAG_REFS flag.

When SKBFL_MANAGED_FRAG_REFS is set, the skb doesn't hold a reference
on the pages in shinfo->frags. Appending those frags to another skb's
frags without fixing up the page refcount can lead to UAF.

When either the last skb in the GRO chain (the one we would append
frags to) or the source skb is zerocopy, don't merge the skbs.

Fixes: 753f1ca4e1e5 ("net: introduce managed frags infrastructure")
Reported-by: Huzaifa Sidhpurwala <huzaifas@redhat.com>
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/c3b7f906bbfcbdfd7b4fa9d6c18a438870df85be.1779307748.git.sd@queasysnail.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
net/core/gro.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/net/core/gro.c b/net/core/gro.c
index 9f8960789b2cf..a847539834679 100644
--- a/net/core/gro.c
+++ b/net/core/gro.c
@@ -109,6 +109,9 @@ int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb)
if (p->pp_recycle != skb->pp_recycle)
return -ETOOMANYREFS;

+ if (skb_zcopy(p) || skb_zcopy(skb))
+ return -ETOOMANYREFS;
+
if (unlikely(p->len + len >= netif_get_gro_max_size(p->dev, p) ||
NAPI_GRO_CB(skb)->flush))
return -E2BIG;
--
2.34.1
7 changes: 6 additions & 1 deletion SPECS/kernel/kernel.spec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
Summary: Linux Kernel
Name: kernel
Version: 6.6.139.1
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2
Vendor: Microsoft Corporation
Distribution: Azure Linux
Expand All @@ -46,6 +46,7 @@ Source4: azurelinux-ca-20230216.pem
Source5: cpupower
Source6: cpupower.service
Patch0: 0001-add-mstflint-kernel-%{mstflintver}.patch
Patch1: 0002-net-gro-don-t-merge-zcopy-skbs.patch
BuildRequires: audit-devel
BuildRequires: bash
BuildRequires: bc
Expand Down Expand Up @@ -440,6 +441,10 @@ echo "initrd of kernel %{uname_r} removed" >&2
%{_sysconfdir}/bash_completion.d/bpftool

%changelog
* Fri May 23 2026 Omkhar Arasaratnam <omkhar@linkedin.com> - 6.6.139.1-2
- Backport upstream fix 4db79a322db8 ("net: gro: don't merge zcopy skbs")
- Prevents GRO managed-frag UAF that allows unprivileged LPE via io_uring SEND_ZC

* Fri May 15 2026 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 6.6.139.1-1
- Auto-upgrade to 6.6.139.1

Expand Down