Article View: linux.kernel.netdev
Article #26669Re: [PATCH net v2] ipv6: reject permanent flag on temporary addresses
From: zhuorao yang
Date: Fri, 04 Dec 2026 02:27
Date: Fri, 04 Dec 2026 02:27
64 lines
13429 bytes
13429 bytes
Hi Johan,
Sorry for the mistake. v1 was already public, so v2 should have stayed in
the same public thread and included Ido and the other maintainers. I
incorrectly sent v2 only to the security address.
I am resending the v2 patch below and will keep all follow-ups on this
thread with the original maintainers and lists Cc'd.
Thanks,
zhuorao yang
From db6f7539c0976c8199553890603d8bd39adc09e1 Mon Sep 17 00:00:00 2001
From: zhuorao yang <alex000young@gmail.com>
Date: Wed, 2 Dec 2026 15:02:22 +0800
Subject: [PATCH net v2] ipv6: reject permanent flag on temporary addresses
When userspace omits IFA_CACHEINFO, RTM_NEWADDR initially marks an
address permanent. A finite valid lifetime clears that flag before the
address is modified. inet6_addr_modify() clears the permanent bit on
the existing address and then ORs the requested flags back, but leaves
IFA_F_TEMPORARY set. In the no-cacheinfo case this creates a temporary
address with permanent semantics.
If keep_addr_on_down is enabled, addrconf_ifdown() first removes the
address from tempaddr_list and then preserves it because it is marked
permanent. A later RTM_DELADDR calls ipv6_del_addr(), which deletes the
already poisoned tmp_list node:
BUG: KASAN: maybe wild-memory-access in range
[0xdead000000000108-0xdead00000000010f]
Oops: general protection fault
ipv6_del_addr
inet6_addr_del
inet6_rtm_deladdr
Temporary addresses are never permanent. Clear IFA_F_PERMANENT from
the requested flags when modifying a temporary address so that the
existing replace operation remains supported without creating an
invalid flag combination.
Fixes: f1705ec197e7 ("net: ipv6: Make address flushing on ifdown optional")
Signed-off-by: zhuorao yang <alex000young@gmail.com>
---
net/ipv6/addrconf.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index d9d13e78bf13..8d7c316f3eb2 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4928,6 +4928,10 @@ static int inet6_addr_modify(struct net *net, struct inet6_ifaddr *ifp,
if (!(ifp->flags & IFA_F_TENTATIVE) || ifp->flags & IFA_F_DADFAILED)
cfg->ifa_flags &= ~IFA_F_OPTIMISTIC;
+ /* Temporary addresses are never permanent */
+ if (ifp->flags & IFA_F_TEMPORARY)
+ cfg->ifa_flags &= ~IFA_F_PERMANENT;
+
if (cfg->peer_pfx &&
memcmp(&ifp->peer_addr, cfg->peer_pfx, sizeof(struct in6_addr))) {
if (!ipv6_addr_any(&ifp->peer_addr))
Technical Details
Message-ID:
<bf54add17e884aa5853605ca2d8ea6f7@kernelpatch.local>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376983-linux-kernel-netdev=dewy.ruReferences:
<20261201122605.8080-1-alex000young@gmail.com> <69abf63fb4834193b3cea20ee57d2151@kernelpatch.local>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376983-linux-kernel-netdev=dewy.ru
From: alex000young@gmail.com (zhuorao yang)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2] ipv6: reject permanent flag on temporary addresses
Date: Thu, 03 Dec 2026 18:27:22 -0800 (PST)
Organization: Usenet Network
Message-ID: <bf54add17e884aa5853605ca2d8ea6f7@kernelpatch.local>
References: <20261201122605.8080-1-alex000young@gmail.com>
<69abf63fb4834193b3cea20ee57d2151@kernelpatch.local>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="2655561"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:UNSvx7tHCTB4yaT+TFadmJ5AxZ8= sha256:6cECdjOyLldeRZ6MvayIrG8LEv4y0XDidQ8XoWkjMys=
sha1:2Qn0JvIzJ1mtD/Nfbo7QPrghFpw= sha256:RCGQUWlYor62jYvhqgweq/uRaUjDMayYSbmgathLe+Y=
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 2CA80117AB6; Fri, 4 Dec 2026 05:27:40 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.397
X-Spam-Status: No, score=-3.397 tagged_above=-9999 required=6.31
tests=[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.001, 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=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 yvhWO3sJzO4q;
Fri, 4 Dec 2026 05:27:37 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376983-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 6634C116D9F; Fri, 4 Dec 2026 05:27:28 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id 3FEEC22FBD; Fri, 4 Dec 2026 02:27:27 +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=1796351245;
b=3pDuLx4+bu0NX26P8l94eJUojxM8vV7TxBTct190EBn7hM62cDRFE1Z8L5egIaOhdc6I
AXaSkOSbI85FY/X3kAgIMhCXBEcjQajGM9E3+Qy1F43POI80xabFGA1jqXSczIV7DLOzz
yREX3hOVU8ckt4xNcg0vSnhIIrzrLzuWOobLWYFTCCPe7j9eddF67n4cR742RlSaSugXi
AahB/qRc7lhljjgUllbJXTn7m64Jzkke0HVtQwVDsOrQj3biU/WTPPWP6HE13Ggy2pnWk
xIt5g79uYLyHacyctVBzxPkvKCZgqn3Ri8DPOkyrIo22+xvJ0ZzuL7Q6lwEQth9AOWA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796351245;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:Date:From:To:Cc:Subject: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=FrFRemZ/C/SyitbYC/oAOOWnOPY0YEMveEsfW6W4vRU=;
b=x3AJjDWUG8VDzA0Zzgf8dTfeHqGAeGjoU2ND+5ZZz5Juhgi4YwcrRFMJkmSTmnheByZm
21pksRoXBrp8uubVv9wS6sNSYvhJ9LTbLuu1Bxr+dsEAyLFOIDCt21plXBEd4c7+LSI71
Dr7kinepKgeTD+LTvlR9R0Jdck5asjbUuMZq3MVdjrqVrSjoIP6dLzMD2bx9CcJadVsRL
uvk19Xwmq7cdGyMGWIFSPl9yFBgKDeJbsNxpROPTESM/ueBULO+J3N1Hv/qav1Zv3FfD1
1++fwzRZiJvH7OjFEwT7nzUW5K4SBgdtFLEKyzD+zt25ZjiFjB+Utl+YzQ9wZ76lr0A==
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=rfowDWtV;
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 F08BE606A338;
Fri, 4 Dec 2026 02:27:24 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=rfowDWtV
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.173
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796351244;
b=H2PJDDD0nr/rMgO0AWAB6XKJKKW5YTmegREBQlJrTwIMczW3w4G2Kz6+T60e1VA7TCfx
IBVKv/shOZOuaXVe3QWEVZJa4obTL62FuXtGoqIRCiDY4A0JxE9zQki4fj1Lqnp065Ril
VzI4FaRK00+gYfqLgy+EvwGZqXNS2UZE8q0hzqAC9zeKeI+glxAYVcHd2BYn62eYf+FFJ
OXFhP4IcPnWQpaPVJ1VrhHy8W2cY1APYuSXOrwpU7NF8QCLd29lcreOgU/iWf+chNqVLH
fAtAKlaGx2ucQXwxRNCy58UW4kqcza2/xQEI7XXPEDM0JFxWB7LKGFgRaF4yst9Ogdw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796351244;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:
Content-Type:Content-Transfer-Encoding:MIME-Version;
bh=FrFRemZ/C/SyitbYC/oAOOWnOPY0YEMveEsfW6W4vRU=;
b=xquwJDiPBnDltTPBf06ULH+nfEl0jWVUBS8h7DVvygbAYSelS4/z6UOB+rLpB4vWvUmV
ZIUzKH8HHJ0iDt6IfK61Mq0IWucoAv8k6r5zzYLBOvbyfp5xRM3SH2+DynLj2tuA2+/x8
bSpG1teg3mPYeDREXEyqi0zXcAIZBH44651sWX7V5q8p4OwsO65mHHh8Z3h3pKV9ZBqhI
zckXIVTL+HgjJf2Skke1P1QzVFNdsa/eM3n3b0uBpAAHlIsdXBddCDvxm330lbyihct0N
bJ4bUaVMzUPE4UAKETRyFOzmgPyshfJiEHC6z0iLJg2UyvfSLTxwXomFohrLn6+L6cw==
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=rfowDWtV;
arc=none smtp.remote-ip=209.85.214.173
X-Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173])
(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 BAD42606A322
for <netdev@vger.kernel.org>; Fri, 4 Dec 2026 02:27:23 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BAD42606A322
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-pl1-f173.google.com with SMTP id d9443c01a7336-2f0464dd6b6so3654335ad.1
for <netdev@vger.kernel.org>; Thu, 03 Dec 2026 18:27:23 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1796351243; x=1796956043; darn=vger.kernel.org;
h=mime-version:content-transfer-encoding:content-type:references
:in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=FrFRemZ/C/SyitbYC/oAOOWnOPY0YEMveEsfW6W4vRU=;
b=rfowDWtVUWkoYWStHvUuhokO5rFQkQ6EbTYCEkIM+x3tzs5XAdUI8wkXgXnSZLOHZJ
FnmZmHSXAKi9gR1QDoMbg15rv/K2CI/U8k+cVDax0uUg3Bsm3uW1wha8apPuRTZtPfcr
BgsJ1iIzxNtN6oaHTxJGn1zq/FC5kn+qQ3n+aFZUySuN9DUjFccvpcthLpNVtqsJ/h2n
524v8pp9QEDl9nfm9Ofaml5YgI2Rro8C1iiOO5rTnyjPaGDQAJ2IUJeELzooxgliMfFw
NxOya3B2L3KEmYUqgEOKrhxUbRGpFrjr1+m7sfdgpGWuvVDh/rtoPNfTjx1l8SIo4YWb
FW8A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796351243; x=1796956043;
h=mime-version:content-transfer-encoding:content-type:references
:in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=FrFRemZ/C/SyitbYC/oAOOWnOPY0YEMveEsfW6W4vRU=;
b=W9jLFx0b8cdXNCu2stSbx7m0J0OuEca0xvewe4CRwwJJew6CGqNs/aLuUHrk3QwRtN
uCagwxDTqBBoHsuRpeeGWArE0yqAr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oMNs6LRQwBQ3EnAO/2m9HRMaA
TOPUpw==
X-Received: by 2002:a17:903:2301:b0:2e9:5ed2:c3a3 with SMTP id d9443c01a7336-2f1ba1953b9mr4596285ad.37.1796351242618;
Thu, 03 Dec 2026 18:27:22 -0800 (PST)
X-Received: from [127.0.0.1] ([219.152.236.33])
by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f1b791e37fsm2807565ad.40.2026.12.03.18.27.19
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 03 Dec 2026 18:27:22 -0800 (PST)
X-Cc: dsahern@kernel.org, idosch@nvidia.com, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, willemb@google.com,
netdev@vger.kernel.org
X-In-Reply-To: <axEqL4y2QHIaJ8T2@hovoldconsulting.com>
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