Article View: linux.kernel.netdev
Article #8986Re: [PATCH net v2] ipv6: raw: fix use-after-free in rawv6_send_hdrinc()
From: Zhou Qiuyue
Date: Fri, 30 Oct 2026 17:38
Date: Fri, 30 Oct 2026 17:38
15 lines
11613 bytes
11613 bytes
Thanks, David. Yes, in the redirect case it passes the old rt->dst.dev, while skb->dst has already been replaced. That changes the NF_HOOK outdev, so it probably belongs in a separate fix. A bare rt6i_idev or dst.dev pointer looks unsafe, since dropping the old route drops the refs they rely on. An explicit hold/put could replace the RCU lock, but adds per-packet refs, and doesn't avoid the deferred route free. As far as I can tell, that uses the embedded dst rcu_head; the temporary rt6 in this path comes from the existing HDRINCL lookup, and v2 doesn't add a new alloc/free there. I'll test moving the RCU read lock before l3mdev_ip6_out().
Technical Details
Message-ID:
<179338190237.9376.13820542101227461550@gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353866-linux-kernel-netdev=dewy.ruReferences:
<20261026044808.613-1-n0ps1edzz@gmail.com> <20261030160532.4832d994@pumpkin>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353866-linux-kernel-netdev=dewy.ru
From: n0ps1edzz@gmail.com (Zhou Qiuyue)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2] ipv6: raw: fix use-after-free in rawv6_send_hdrinc()
Date: Sat, 31 Oct 2026 01:38:22 +0800
Organization: Usenet Network
Message-ID: <179338190237.9376.13820542101227461550@gmail.com>
References: <20261026044808.613-1-n0ps1edzz@gmail.com> <20261030160532.4832d994@pumpkin>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="2286439"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:ygH+Sa08KXjVxDSVK+H+XDGlXMM= sha256:q0y3jyyrhO+0JEjynKghlgIw6Vl7k4dZQJQRqX1IkOI=
sha1:q5qRVZth67g27n3fF5sRsNwfOOE= sha256:miioshh+obItttuz6kc53SvDN2d85BFk8gzr3VVHVC4=
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 4EAF5125CA5; Fri, 30 Oct 2026 20:44:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.047
X-Spam-Status: No, score=-3.047 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, 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, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.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 GS5yq3n4jU6B;
Fri, 30 Oct 2026 20:44:11 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-353866-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 1DA6A125CA3; Fri, 30 Oct 2026 20:44:02 +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 0EB43255F8; Fri, 30 Oct 2026 17:38:33 +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=1793381911;
b=0r0TyyjoV29JVfi63OHWYNZzH7BubMMbY/lw4/LWAr3BzRf/Z7QNmzHHhuwn1uJCKqF/
uJA2qurAi92V3rsUwyh8i/IbIqs/EfAvIbMadxUft18GU32QQYTFqLBG4xtLm/8fd1Lp8
KZszDbPVfRTq+qMa+wvzFNwqGZpVB2FEHibT+c85rbmbKX50psX+woT0TdR//VCXTBEkr
Bi33zvgpaX1P+nWc+LaZhLkGYd0mZBO8/LHsau7K8Vb4hFpX38QyHltYy30ur5hkhrpuX
er55McG/MM/W8iw6uuQkkLBHtV0SBJqQ4vxGOX6qlImbwwd7XlUnxG50XeFGMnKsh9Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793381911;
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:In-Reply-To:References:
Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
Precedence:MIME-Version;
bh=EoW6Fc+Q4vJcb/scjylrIakaVWrk6eQ7R0akCKO3swU=;
b=f4tXAPZISkJZSORoSP4g7J1HEu0YA9rAfJiMPfXwzlrLVLtyZg70NkI2Z+P620btrMe4
Dax2utodBTjh8/b0PESR0XSg5lUhZ6ClZKR5kpKMMahHSbf5FVZWEZnWUvZWQzwcrNjsB
kmxNSUurX33BbzzlpJE3xRxw5/BA3ig+beNCBrBzPbs3Wu5mvE/Xq0q+NTrX78amLuH8R
bVvABIWOVe3dR9vT1rz+DRy6pEPaeI4QuhfMKEWbEA94bbDGl8P/EwWga6Lw4d6tvSz2t
ZTyL1NJ7xYznibgKjr/s8+wUghEo8v7IY+T3hQVHYaWBmTukxVIZD3F5BS6VTqyTfrQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=XQouLIkm;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.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 27801606A32E;
Fri, 30 Oct 2026 17:38:31 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=XQouLIkm
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.227.136
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1793381910;
b=sMcv1tDSJljI8wptG+yzRcSTNV1n6tEELGBGRUle4VR1oouvXDnBcAMLLsOxg1EY+5io
dpC+4uITfhiutswd/j5GfbWD4YIlROe67DcwUKp3BUmI7qRf68IzXMRECEhx7Q4Smz5HI
C3dsS0qYQXhOmmxtZ97Tq5iwj02srq48Sfe4F43KEk4Mil1kOJUYTqp9NcW653su0sQ7d
F5TIc0Vbi9zgQ/L/J6gCPBN2+/ytrvfwxVl4dI4HCOINiQuktefwfJb5+ulmbQLdHw28L
2mXIziAJhMAT3Pof93RipibKKGJVCGX9B+6oxStWSpTp8x+aNDPSnVn+vovrJSOOyuA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793381910;
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:In-Reply-To:References:Content-Type:
Content-Transfer-Encoding:MIME-Version;
bh=EoW6Fc+Q4vJcb/scjylrIakaVWrk6eQ7R0akCKO3swU=;
b=Kz/+qLk3fU2XM7AiNNAbZrzqagee7JrRQTCePfKLJ+VC4WD5LNZ7dC0nAOAhV6yS6CLN
AWznHwJruGrEiH4YRtTHXz3Uk/K+AN50GG4GU2HKViFL0nzWoD5IwBRaus5uVZyTlpHfz
iTPVLREd8LFoCqml3FRinjFr9Xa0FEI++DI+H/VhsTUw15oVDNfQWW4dyZzVGIFolmhXF
It6ev7g8lafkVbtdYNRZWmSgtfEGCXxBvAVl0uBv/PZ7PNCnxgnTXlo8F07OoZzUzdlc0
b4zADWlqe3VknnMVr0csZtsTagOG15r33zBC+HSsFdrectRg7T4zfFUriCTmCgbMzvg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=XQouLIkm;
arc=none smtp.remote-ip=74.125.227.136
X-Received: from mail-pj2-f8.google.com (mail-pj2-f8.google.com [74.125.227.136])
(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 EF171606A31E
for <netdev@vger.kernel.org>; Fri, 30 Oct 2026 17:38:29 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EF171606A31E
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pj2-f8.google.com with SMTP id 98e67ed59e1d1-3ae93a86008so506163a91.0
for <netdev@vger.kernel.org>; Fri, 30 Oct 2026 10:38:29 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1793381909; x=1793986709; darn=vger.kernel.org;
h=mime-version:content-transfer-encoding:content-type:references
:in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=EoW6Fc+Q4vJcb/scjylrIakaVWrk6eQ7R0akCKO3swU=;
b=XQouLIkmjjIbQtl2AB5ZG9lylmU8nhd4x06gA5H3Dg2o8TGbD91XfJ8zmdKyg6WEQj
VTNTE856maSNVLT4CiKfaa57Zz+4e/N4R97C4tNY2DtRLOk1rk2MuWOP8+U3aNgXOCjb
KafuoeCTOUxvtpA8MWYS6qVuAftb+CkbJxUdu1/PamLvCNItdLQicYAfMAlKRTUUCRIg
Ei7f8+u7lwtZbfXplmb1RS4Hj9pKU1NHpL9N7q+Tg0O+34P7ISWtTFYIu5rWgWhzd8Br
8oulUFTKjxpAOWH4rKy45/MJHuihRSaaxDx6wfleMHOsocP6+xrjw4enObQ3iNxNq6wI
+TYg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1793381909; x=1793986709;
h=mime-version:content-transfer-encoding:content-type: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=EoW6Fc+Q4vJcb/scjylrIakaVWrk6eQ7R0akCKO3swU=;
b=iXZZuhPKVYi5a4Q0G05cidZ3TSJV9Jnvnw4WoCA4LbjO+Z3tQsZ1oPA5N+DCN98ASV
zZ/rDFNKpIjh3As7FZJEEC2xF80KmfIrDoez3J7+AiZUYvU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3ae8980a25bmr2636860a91.66.1793381909231;
Fri, 30 Oct 2026 10:38:29 -0700 (PDT)
X-Received: from [192.168.43.2] ([119.234.99.118])
by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3ae84596e3bsm4964258a91.9.2026.10.30.10.38.25
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Fri, 30 Oct 2026 10:38:28 -0700 (PDT)
X-Cc: netdev@vger.kernel.org, David Ahern <dsahern@kernel.org>,
Ido Schimmel <idosch@nvidia.com>, David S. Miller <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Hangbin Liu <hangbin.liu@linux.dev>, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
X-In-Reply-To: <20261030160532.4832d994@pumpkin>
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