kernel: backport "net: gro: don't merge zcopy skbs" (CVE-pending)#17414
kernel: backport "net: gro: don't merge zcopy skbs" (CVE-pending)#17414omkhar wants to merge 1 commit into
Conversation
|
@microsoft-github-policy-service agree |
|
Thanks for the contribution, @omkhar . We're taking a closer look at the backport and will follow up shortly. In the meantime, please retarget the PR to our cc: @allenpais |
Backport upstream commit 4db79a322db8 ("net: gro: don't merge zcopy
skbs") into the Azure Linux 3.0 kernel-6.6.139.1 package.
skb_gro_receive() can currently copy frags between the source and GRO
skb without checking the zerocopy status, 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
leads to a use-after-free.
The fix returns -ETOOMANYREFS from skb_gro_receive() when either skb is
zerocopy, preventing the merge. Equivalent to the upstream net.git
commit and the same one-line addition shipping in stable kernels.
Fixes: 753f1ca4e1e5 ("net: introduce managed frags infrastructure")
Upstream-Status: Backport [4db79a322db8c97f7b73b8a347395ef4d685eb40]
Upstream-Author: Sabrina Dubroca <sd@queasysnail.net>
Reported-by: Huzaifa Sidhpurwala <huzaifas@redhat.com>
Verified empirically on Azure F32s_v2 VM running 6.6.139.1-grofix:
public PoC (lcfr-eth/2566a5cef312c94a5ff8d62fa417955f) succeeded 4/5
trials on unpatched 6.6.139.1; succeeded 0/5 on patched kernel (page
poisoning sentinel observed in PTE[0] each trial - UAF prevented).
`gro.sh` selftest passes ("All Tests Succeeded").
|
Retargeted to |
|
How exploitable this thing is? It's already 3 days since publication of zero day exploit, and there is no CVE yet... |
|
CVE requires the kernel team to go through the process of registering and issuing a report. With the speed exploits are being generated, it seems like the official CVE lags the exploit and fix by a while (see some of the recent exploits like copy_fail). Unfortunately, the lack of a CVE isn't correlated to exploitability. That's the definition of a 0 day. |
|
@omkhar, we need to get this via the stable route. for now, we can look to carry it as OOT. We'll work with stable maintainers to get this in. |
|
Thanks @allenpais — OOT carry until it shows up in 6.6.y stable works for me. Going forward I'll keep the bar high: only ask for OOT when there's a public PoC achieving LPE/RCE on a stock kernel, or active-in-the-wild signal. Anything below that I'll just wait. AUTOPATCHER on 3.0-dev is empirically pulling 6.6.y stable within ~1–3 weeks (139.1 on 05-16, 138.1 on 05-10, 137.1 on 05-01), so the spec churn and eventual revert isn't worth it for the rest. Fair warning: I've got a handful of other kernel backports open against 3.0-dev today — #17416, #17417, #17422, #17424, #17425, #17426, plus #17421 and #17423 still pointing at On the stable route for this fix: Open question on Mariner 2.0 for the deployed fleet: cgit on |
Summary
Backports upstream commit
4db79a322db8("net: gro: don't merge zcopy skbs") into the Azure Linux 3.0kernel-6.6.139.1package. The fix prevents a UAF inskb_gro_receive()that allows unprivileged LPE via io_uringSEND_ZC+ veth GRO.Why this matters for Azure Linux 3
SKBFL_MANAGED_FRAG_REFS, introduced upstream by753f1ca4e1e5) is present in 6.6 LTS → 6.6.139.1kernel.io_uring_disabled=0)6.6.139.1-1.azl3(Azure D2as_v5 VM, F32s_v2 build VM)Change
SPECS/kernel/0002-net-gro-don-t-merge-zcopy-skbs.patch— 3-line addition tonet/core/gro.c'sskb_gro_receive()returning-ETOOMANYREFSwhen either skb is zero-copy%autosetup -p1so the patch auto-applies during%prepReleasebumped to2%{?dist}; changelog entry addedEmpirical verification (Azure)
Built and booted
kernel-6.6.139.1-2.azl3.x86_64(6.6.139.1-grofix) on an F32s_v2 VM:6.6.139.1-1.azl36.6.139.1-grofixlcfr-eth/2566a5cef312c94a5ff8d62fa417955f) over 5 trialshax::0:0::/root:/bin/shinjected into/etc/passwd)0xdeadbeefdeadbeefobserved)tools/testing/selftests/net/gro.shskb_gro_receivedisasm — `skb_zcopy(p)Test plan
%autosetupagainstkernel-6.6.139.1-1.azl3SRPMmake -j12 vmlinux bzImage modules)References
4db79a322db8c97f7b73b8a347395ef4d685eb40753f1ca4e1e5("net: introduce managed frags infrastructure")<sd@queasysnail.net><huzaifas@redhat.com>🤖 Generated with Claude Code