Article View: linux.kernel.netdev
Article #6414Re: [PATCH v2 net] net: skbuff: propagate shared-frag marker in skb_zerocopy()
From: Eric Dumazet
Date: Thu, 22 Oct 2026 11:06
Date: Thu, 22 Oct 2026 11:06
30 lines
9757 bytes
9757 bytes
Le jeu. 22 oct. 2026 ร 12:43, Zizhen Liu <pointerliu@126.com> a รฉcrit :
>
> skb_zerocopy() moves frag descriptors from @from into @to and takes a
> reference on each frag, but it does not copy skb_shinfo(from)->flags into
> skb_shinfo(to)->flags. A destination skb holding the same page-cache
> backed frags as the source therefore reports skb_has_shared_frag() as
> false.
>
> That breaks the invariant relied on by later in-place writers. ESP input
> checks skb_has_shared_frag() before deciding whether an uncloned
> nonlinear skb can skip skb_cow_data(); with the marker lost, an skb that
> skb_zerocopy() built for nfnetlink_queue or for an openvswitch upcall is
> decrypted in place, letting an unprivileged user write into the page
> cache of a root-owned read-only file.
>
> Propagate SKBFL_SHARED_FRAG when frag descriptors are copied, as done for
> the other frag-transfer helpers.
>
> Fixes: af2806f8f90a ("net: Export skb_zerocopy() to zerocopy from one skb to another")
> Fixes: f4c50a4034e6 ("xfrm: esp: avoid in-place decrypt on shared skb frags")
> Cc: stable@kernel.org
> Signed-off-by: Zizhen Liu <pointerliu@126.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Thanks!
Technical Details
Message-ID:
<CAL4WiiqsmV8yKzU_HnE5tFXHqf8rMabGP9_-4B6gAdGZwhzjOQ@mail.gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350524-linux-kernel-netdev=dewy.ruReferences:
<20261022104217.1852191-1-pointerliu@126.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350524-linux-kernel-netdev=dewy.ru
From: edumazet@kernel.org (Eric Dumazet)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v2 net] net: skbuff: propagate shared-frag marker in skb_zerocopy()
Date: Thu, 22 Oct 2026 13:06:29 +0200
Organization: Usenet Network
Message-ID: <CAL4WiiqsmV8yKzU_HnE5tFXHqf8rMabGP9_-4B6gAdGZwhzjOQ@mail.gmail.com>
References: <20261022104217.1852191-1-pointerliu@126.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="195963"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Q0b9hVWnIQowMQESOEU60OELMzE= sha256:exGUAPxBWUXWvggJKRCHIFsk8Hv/ZwFGtjfiLwn5iRU=
sha1:BHqmmcAB4RNK/J40TCYAG9CXQ2g= sha256:1EAS55CtJaZ/BSCjoQNezG2PMtHNvtqBoBfbt1Plejs=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 93D7D111256; Thu, 22 Oct 2026 14:11:45 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.739
X-Spam-Status: No, score=-3.739 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.339, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 2A1xHHSDL7s4;
Thu, 22 Oct 2026 14:11:38 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-350524-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 6DFCB11124F; Thu, 22 Oct 2026 14:11:29 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 971D22A87A; Thu, 22 Oct 2026 11:06:43 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1792667203;
b=5CnSV+qn2ISSluvm52YQBrkmSOtYmMq63Ru3PymD1H7CiRp1QSt16ZFGOH/Sfe0ayjzK
op1JHNu5I2TL+TNvgPrFYG+mceSsUwvBZNxfcx1TOsCXDB94aJcU+1i9Ianbw4k+N/Gr0
nyzuUgqJzNzQzZDQjr+fntxfMXQObdT+BSLrKMcgnB0sphwbttdtyMwVPJaTAeou/WS4g
VlKFoFvEV8splCKGxrYC7ZN5cseBYDXeXo7vbXduYMM+F/+aef8dAbAJCHtzt5iLY1NFe
78CSWBu+ADUCLlUmTRtTL3uFm91EdNnOQTjR+ec9EYfGSvdISr0ujIvhcx9zBYXXK0Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792667203;
h=X-Original-To:Received:Received:DKIM-Signature:Received:
X-Gm-Message-State:X-Received:X-Mailing-List:List-Id:List-Post:
List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
MIME-Version:References:In-Reply-To:From:Date:
X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
Content-Type:Content-Transfer-Encoding;
bh=xyOyJxMQ69YYHJQNozgzVZmUmKFP/XM6lCT0sjk2uzw=;
b=tL0MgktD38LbOfYO3Y39pEebh7XdOL/n0DwUmM3tUVyYU0DGqYl41JVrg0WsJoVWzoAQ
yjx3Fmf7ni1oJKOZYIs4zsxMg5rheMsSiRyVis/e3E1fyLDPYQaOOzohLAUeu/o3SJfbW
qkNz44SqjzazTdu1aAzaVx2+pylA6JtrAWJVIL0EB8JzKGf1dUR6gz20gcxxjNJTjgsL4
JgLS+NQkCkriXe5Xm9nuU6qa+bqG2QdaNg1PG6WmfOz7RJRpuAZHmdXH3BMdtQU48mCAB
0J6rDQPMHmJQvPSHnXmrVuZCKmUUHEcE2rQD5kgzgEx+6HBAr/EcP8b66K8cYebi30w==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VnqAu3al;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B286606A321;
Thu, 22 Oct 2026 11:06:43 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VnqAu3al
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1792667202;
b=RinyjOWYVtISad7G+tI/Aa+fOq+/19ZoJAGV5BVbfwtx1zKlv1dYJd6pklLN1DqFI54u
fIMIVuJVk9yK76qSuVZAfpJBqloyT3JpwBXxFzMC9XdhUNHRcU/QiqrkALYRqMx0yl7dd
F5F5aDGaWpEi8cXSI7BWLqupBZSxx7VSjFspfE3v7OiuHB9kmYPH9fv1K9dn53VDMj+a1
N7An4yFmO7i/swypZz8V5U6P+GC9Y9Meta5DCWrle9wg6gTHGYsDSiD9nhtrsjCKnrAR2
okhIXC56jZwdcE7B6gr+8txLYshCv04/pqpIIt9Q7zxfv6Qb2Jq6aANE5r8X/fgbIhA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792667202;
h=Received:DKIM-Signature:Received:X-Gm-Message-State:X-Received:
MIME-Version:References:In-Reply-To:From:Date:
X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
Content-Type:Content-Transfer-Encoding;
bh=xyOyJxMQ69YYHJQNozgzVZmUmKFP/XM6lCT0sjk2uzw=;
b=PErJSaCcVCPo4hCEObbJhTO8a1i3qmieP1U56eBRP3chs2KC6bngdDOAcsCkGzPGhcsf
cc4FQqtZ073yBN+FsurdPx6FE9CLIfxBrHadkAa2uMK5a+d3kMNYs+Fpagsgoa+y4t2Ii
Ict9kxnCdXf67CNyaxbVmwdJkp0XjWLSMUavE3wCfL8o1BAtAItTZ6VSdjBNYfU+3fkUz
VnJGDvtDZPpn8v3aRCqVYmJLvTn3xPMXgt63jBXHON+3V6hWigPCe6PcIWy0geub5NFkT
NhAj+WDqjhdQ73ick5UJWn209cfWwB3mlPPI1DCVjiST0zqVhkhx1caDtzuLin0vq+g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VnqAu3al;
arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A258606A319
for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 11:06:42 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8C8B1F000C6
for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 11:06:41 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
s=k20260515; t=1792667201;
bh=xyOyJxMQ69YYHJQNozgzVZmUmKFP/XM6lCT0sjk2uzw=;
h=References:In-Reply-To:From:Date:Subject:To:Cc;
b=VnqAu3aluJYl12qKjic1cjl1jt89jwBWTfhlSawM2+IPoJfacvQMpyIZO+Bhs+CMc
GVIHtl1YSL5Kx3NR52HcmRnE0S6P/RKCs5WPY4Ci64/Y1KWXp/RTHnSzKsb9LFj6nD
iCYDTNWoxNEgO26kW8+VBLS0iSg1mqddtVi9U5qEEa5RvHfP/rSUuGGHhERNFuiL/C
n31gL3bdznG/658InT5Gjj6Xe7HNUPt7hwe35blGMnTHAP/AsgaNAND5giMR8GPpMZ
mqljMN//KfF0d52wHN5jWikzW1hrcD2RApO5y/nLarCNdyIKkL1/4TbrYH1qdP1Gwe
oXGLw03C7ulQQ==
X-Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-48e9476e26aso702103fac.3
for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 04:06:41 -0700 (PDT)
X-Gm-Message-State: AFq9FYLaLJ1tK2BjdWjNPN36Koy+PqpUJPWJjZXQtzrfQ18n7Yla84Mf
FZCnRtCjX/Uiui4yfUIoeDfdQl7ajXhbKl2+4ghDDzkXuKCdh3a4qNnHoGky4X+DwOXaqulfiFR
GSnjlNL5wicHMznxpNfVoKI/PkhLEs1A=
X-Received: by 2002:a05:6870:ac1e:b0:47d:4141:6248 with SMTP id
586e51a60fabf-4a7dc2823a9mr3325025fac.30.1792667201216; Thu, 22 Oct 2026
04:06:41 -0700 (PDT)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261022104217.1852191-1-pointerliu@126.com>
X-Gmail-Original-Message-ID: <CAL4WiiqsmV8yKzU_HnE5tFXHqf8rMabGP9_-4B6gAdGZwhzjOQ@mail.gmail.com>
X-Gm-Features: AclHuK8s4n2wbqM2GmJ_qfaTtbQ4-ruc6q-HN6ENlhgolb_xi9FSnmK-OYjbiqE
X-Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, stable@kernel.org