From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C3CF408035; Fri, 4 Sep 2026 05:34:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788500045; cv=none; b=uojQrsAN0tklS/SZyPUEKTolg/mizMN6OZkYOryW0XLzXwUG0VmiQL6FewOY3wWevyz/9/NFJEpXezC3AzSjfNYBeKoQTfNFshff/jiBNO03PXmyIgk3wbcWtf98UU122OiHgu6j9xTQeo0fvJABk7+gfzsoJu9gZuugZIOIMu8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788500045; c=relaxed/simple; bh=FEmyzGK0y1LjmEADWPi27cKY/J2/oF2eG3erii90nIQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JnqxRdTTZzxaxZUeiB87En+zHdfnhT4GxnxwCBogAToU+m5y3MWrHr2M7OM1pGlwTC8dbQEc5jgQFiRqrAZ3umDiHttYANMCO4e2guPEufSsi+rEjZ3z+j5I8KpoGCMoiDH/M1Pk5dC8Lx3nbT2JF3SUN4zv6tBYlKn9f4DkxU0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IlRRSf9A; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="IlRRSf9A" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82A1A1F00A3D; Fri, 4 Sep 2026 05:34:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788500044; bh=t4BfCXRrNHxcd2MMBmUb20K5BtMtEF0ejGrwY9dDl48=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IlRRSf9ADSNOIO54sMcz4LEr6++3V5r4TWm3DOkjtr8OAM2PTobsfgm0W1zvdL9S6 GIxDKMYRKzR4L2+qlLK1jQ5kdOUHgN06IbbIuc2anWwmL7FHhBBvk4jdweLNkR+hZv bAZUEnNBDIXRpQxgUvweVIUQWqno16tOnaC0wWFk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ilya Maximets , Norbert Szetei , Jongmin Jang , Willem de Bruijn , Paolo Abeni Subject: [PATCH 7.2 629/713] net: skbuff: dont touch shared zerocopy state in skb_tx_error() Date: Fri, 4 Sep 2026 06:59:57 +0200 Message-ID: <20260904045817.929201755@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260904045803.810145556@linuxfoundation.org> References: <20260904045803.810145556@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Norbert Szetei commit f66bdb1cc0fcd227a062378f8be0b5873aa5600a upstream. skb_tx_error() completes the zerocopy uarg and clears SKBFL_ALL_ZEROCOPY, and skb_zcopy_downgrade_managed() clears SKBFL_MANAGED_FRAG_REFS. Both live in skb_shinfo(), which every clone shares, while the caller only owns the reference it is about to drop. Through a clone it tells the producer its pages are free and drops SKBFL_SHARED_FRAG for an skb that is still in flight. Open vSwitch reaches this with a non-last OVS_ACTION_ATTR_RECIRC: clone_execute() sends a skb_clone() into ovs_dp_process_packet() while do_execute_actions() keeps forwarding the original, and skb_clone() does not privatise the frags here -- skb_orphan_frags() returns early on SKBFL_DONT_ORPHAN. A flow miss on the clone then strips the marker from the packet still being forwarded, and a later local ESP delivery decrypts in place over frags it does not own privately. Skip it for a cloned skb. Nothing is lost: skb_release_data() clears the zerocopy state once the last reference to the shared data goes. Fixes: 25121173f7b1 ("skb: api to report errors for zero copy skbs") Cc: stable@vger.kernel.org Suggested-by: Ilya Maximets Signed-off-by: Norbert Szetei Reviewed-by: Ilya Maximets Tested-by: Jongmin Jang Reviewed-by: Willem de Bruijn Link: https://patch.msgid.link/CFAB292A-674B-4C14-BB2C-BB8830AD5659@doyensec.com Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman --- net/core/skbuff.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -1417,10 +1417,13 @@ EXPORT_SYMBOL(skb_dump); * * Report xmit error if a device callback is tracking this skb. * skb must be freed afterwards. + * + * Does nothing for a cloned skb: the zerocopy state lives in + * skb_shinfo(), which the clones share. */ void skb_tx_error(struct sk_buff *skb) { - if (skb) { + if (skb && !skb_cloned(skb)) { skb_zcopy_downgrade_managed(skb); skb_zcopy_clear(skb, true); }