Article View: linux.kernel.netdev
Article #6291Re: [PATCH net] net: fix frag_list leak in skb_segment_list() error path
From: Wang Zhan
Date: Thu, 22 Oct 2026 04:35
Date: Thu, 22 Oct 2026 04:35
22 lines
12033 bytes
12033 bytes
On Wed, 21 Oct 2026 18:18:58 +0200 Eric Dumazet wrote:
> skb_segment_list() detaches the frag_list from the head skb and moves
> its members one by one to the skb->next chain. On error, err_linearize
> frees that chain with kfree_skb_list(skb->next), relying on the members
> not yet processed to still be linked after the current one.
>
> This does not hold when the current member was shared: it is replaced
> by skb_clone(), and __skb_clone() clears ->next. If __skb_linearize()
> then fails on that clone, the remaining members are no longer reachable
> from skb->next nor from skb_shinfo(skb)->frag_list, and they leak.
>
> The skb_shared() error branch already relinks nskb->next to list_skb
> before jumping to err_linearize. Do it unconditionally right after nskb
> is added to the chain, so every error exit sees the remaining members.
> On the last member list_skb is NULL, which still terminates the chain.
>
> Fixes: 53475c5dd856 ("net: fix use-after-free when UDP GRO with shared fraglist")
> Signed-off-by: Eric Dumazet <edumazet@kernel.org>
> Cc: Simon Polack <spolack+git@mailbox.org>
Reviewed-by: Wang Zhan <wang.zhan@smartx.com>
Technical Details
Message-ID:
<20261022043537.3481475-1-wang.zhan@smartx.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-350376-linux-kernel-netdev=dewy.ruReferences:
<20261021161858.761205-1-edumazet@kernel.org>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-350376-linux-kernel-netdev=dewy.ru
From: wang.zhan@smartx.com (Wang Zhan)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] net: fix frag_list leak in skb_segment_list() error path
Date: Thu, 22 Oct 2026 12:35:37 +0800
Organization: Usenet Network
Message-ID: <20261022043537.3481475-1-wang.zhan@smartx.com>
References: <20261021161858.761205-1-edumazet@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="128580"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:5UW10BQHZKSpqeehdXHtVte6vX8= sha256:BREMhbO4b1hAsrDWU/kzJf9V4eT5hVR6SF8ia/rFNP4=
sha1:ygceYQd4H9dWmT68SQEmlNCDu9Y= sha256:LlVoER2AQIW6+HWYbZ/mZ5Dh4yIh4mwIeijhYst8Oo8=
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 AECDE1111A1; Thu, 22 Oct 2026 07:36:33 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.95
X-Spam-Status: No, score=-2.95 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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=smartx-com.20251104.gappssmtp.com
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 ORSFO9plbc9p;
Thu, 22 Oct 2026 07:36:30 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-350376-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=smartx.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 22CD5111194; Thu, 22 Oct 2026 07:36:21 +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 2584034101; Thu, 22 Oct 2026 04:36:10 +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=1792643769;
b=2NuumXJJrW0xU6xqqlp9NoMMdm+G+iW5IbXkzuz/zMLhtdnJGcujRC7uB+oQ61lLBnPo
uox+feYo7rNl+uaKTh1mzCLr4/DCqTRW+FG2gAcX/1vHW+i8iZfbHp03nOCfoY9veSaLM
rRJDj02sRjzh9RYAUgcfmhtyBgYpwrMYGa/6NPD3eWxx9MK+rX2g1Hlpbsxeyv8VYK2gl
zFBAiuXw3Cflt1gWpwHWj4qEYQg1adWPyFmrZGYJrx4U2MNSNmvLSPjGaCH345i3WUYOo
QwS04IwYFcZVk4RMgBIS95R9w4Ej3RYGxwE5bRFs9ELT3spFyZeCimjdNmTqpD1B7Ew==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792643769;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:
References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:
Content-Transfer-Encoding;
bh=/7tpPcJ0uUKLTHvPEfaChoh+KwUwTnCA4Qa2nt1mS1c=;
b=Ovkpoca3sl78QYRM96QmTraNRwN6VP8xoh6w0ZAmSbpIDA0F404aDpJdYwR5C0Xg4/RH
sojJ/dZi2OFVuIZ9Hox9VuxJURNWFZ1PZz+LjIT1WJo1SjG5GC2RXGtnWW+4KtSTxo91v
CNiC0yXxy4Z7uW71gzu2RgUZm6X7BhpMqNzmuZq0wF5HcoKqda/wyGpKwuwQBOCOx91No
y+K8OVfW78i5YD6axPN7TbjAqBoZja/B7509HuDnRFnkCJPE6THydgxuwmrx3PZWyL9om
LVgBrGH73ispLqOw+11Itg9FIeEz8PgWzCPPRaPoS2f6pHnb2BryDrRgW78off8hjog==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=smartx-com.20251104.gappssmtp.com header.i=@smartx-com.20251104.gappssmtp.com header.a=rsa-sha256 header.s=20251104 header.b=m3KRsj6i;
dmarc=pass header.from=smartx.com;
spf=pass smtp.mailfrom=smartx.com;
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 73D28606A321;
Thu, 22 Oct 2026 04:36:09 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=smartx-com.20251104.gappssmtp.com header.i=@smartx-com.20251104.gappssmtp.com header.a=rsa-sha256 header.s=20251104 header.b=m3KRsj6i
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.44
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1792643768;
b=vU6QL9LKzMlr/Ed1Mf96670WpUh/Ob+gQAbr4suJbezJjuwWwckHRhUDXygKLHrpMHvS
JE0DbsEw2vuSHYDrkdt+NNgszDB0d0U61QCORFeybpcMolCHM2m7PFKj54m+zdq1n1h2V
iWljtAq5momyECKyafGraTCsiyqgBE0L1xncwLfWGzs6PsGW5iI/FtWbS0YVU9ohr+Hys
M81bV4O7Ukg0qFGNuNlspnwePKZfxQUXlP36x4o01i0Oe+MOLaGrOqCyh/PTkPpUIeEiU
k4fL6ax/UjjGhXoDxBMGUWxcI3IUl8yvz3bTBI1IQK9okrUpOW2Mt4RZwMW3Ui14Olg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792643768;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
Content-Transfer-Encoding;
bh=/7tpPcJ0uUKLTHvPEfaChoh+KwUwTnCA4Qa2nt1mS1c=;
b=y0m9oIzUPA7zQKuYLpmIVUEvMNt3/kV/J1BvWDH17Ni0JGTqr4YtRg8wW0n30JbFk2c7
768fzNECPspV9NEUgUVX5xEej5QwNIbMkXcYcjv7/7FpSBjVFYSXvgwcjmXA3ZaXhWyIh
uhkViGtmLIlVbf1bRhL7yRGCj5+QEiv5KfYy231yagULhkckvAX12RZdKKHI/I9R0Tk8v
DRKKjxthhs+sUgVLKbDBMgrFLDu9aQpgCyrE7gVQ09fFoPGQlqOmos+oAWd+BTZ01yShD
dvbuS3NorgjTZXvhPgtp43d2WEIRGmxeenfMd10PSf0SoWkGE1fX8gLuMUXdRdfpKpQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=smartx.com;
spf=pass smtp.mailfrom=smartx.com;
dkim=pass header.d=smartx-com.20251104.gappssmtp.com header.i=@smartx-com.20251104.gappssmtp.com header.a=rsa-sha256 header.s=20251104 header.b=m3KRsj6i;
arc=none smtp.remote-ip=74.125.82.44
X-Received: from mail-dl1-f44.google.com (mail-dl1-f44.google.com [74.125.82.44])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id AFC69606A319
for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 04:36:06 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AFC69606A319
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=smartx.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=smartx.com
X-Received: by mail-dl1-f44.google.com with SMTP id a92af1059eb24-1846bc43c28so487536c88.0
for <netdev@vger.kernel.org>; Wed, 21 Oct 2026 21:36:06 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=smartx-com.20251104.gappssmtp.com; s=20251104; t=1792643766; x=1793248566; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=/7tpPcJ0uUKLTHvPEfaChoh+KwUwTnCA4Qa2nt1mS1c=;
b=m3KRsj6iAYqkj4vEeMUdHfEuLT6b58tIMnR6uKmMidgysRguWHudVAURWLIvILb7PE
ud//uHY47+iLHj8nvAlJtHxA3rg8LSxuyP+4HkNNTIgadWIQWCSz0y95pIGvieTmYPI9
KBlzU034rtLpnEYuyhzOwQC655A0sSOci/G/0OEu9lro7Tyeh25lxGDXf4fTkrYAdleG
RmwN7gT3VHyRC5+Ic6fXbav299lKI3rk5sn+BLZejIeTxrrItiH0KT2wZxBrM8IQyZoP
jSrRBwOIYWlzQb+2U4lEMqp0A6jgpiwZ/Wy69QNOtHm26p8skuZSOdyYugqVx2NEjsjX
w6kg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1792643766; x=1793248566;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
:to:cc:subject:date:message-id:reply-to:content-type;
bh=/7tpPcJ0uUKLTHvPEfaChoh+KwUwTnCA4Qa2nt1mS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Qb2l/SykVCcd4dc5416dHzwFuhd
jMb5w9i1xkXTtWjfjwQ03IemTALAKhtlIJqgUbIWpgLsC7giMnzIjE3bifj3Q3otx2VTg==
X-Received: by 2002:a05:7022:43aa:b0:187:ec67:2fc5 with SMTP id a92af1059eb24-190a5d7115dmr7374488c88.32.1792643765232;
Wed, 21 Oct 2026 21:36:05 -0700 (PDT)
X-Received: from localhost.localdomain ([23.148.204.128])
by smtp.gmail.com with ESMTPSA id a92af1059eb24-1903bf5d0a1sm11178696c88.14.2026.10.21.21.36.02
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 21 Oct 2026 21:36:04 -0700 (PDT)
X-Cc: Wang Zhan <wang.zhan@smartx.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Willem de Bruijn <willemb@google.com>,
Simon Horman <horms@kernel.org>,
Simon Polack <spolack+git@mailbox.org>
X-Mailer: git-send-email 2.47.3
X-In-Reply-To: <20261021161858.761205-1-edumazet@kernel.org>
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