Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.173 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== 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== 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 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 ; Fri, 4 Dec 2026 02:27:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BAD42606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com 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 Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2f0464dd6b6so3654335ad.1 for ; Thu, 03 Dec 2026 18:27:23 -0800 (PST) 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 uCagwxDTqBBoHsuRpeeGWArE0yqArSeFW6Gv4AFw/MHlBbD97ugvppLh5O9f7HIwhj8s fnPpf3jjcioFu+4Yte9RbriawPrpJ3lzR1+Qx2IzWv/bucM8sq6EbB2xjnArBFiCUs67 F0n/8y9PTkq7vWTUgrkoBfsAT2XO7zrZq2VxnaLdBvYMyPUfQ1APZX4sx9TEzTU91tNk yI/eDH06de6iff//KQej6FVzO6s2fPXVMtBZ/AjuYEFx50zMXMO+hHDNdlyW/PXvrYEa RuGA== X-Forwarded-Encrypted: i=1; AL+hErGm4NCbNWhcE2IxbL58IHRFuGDVKm1VYGUEDpCTrBhvbNHOermBkipL5nN/FHD5CVzPNaNxQ3A=@vger.kernel.org X-Gm-Message-State: APuU4Z/tKfxe34k7dQv6SLt8501U2m594Laie/btVaRny4q2RiiuF5bT sRGEaJCX72NI8beN8r+oAhYqLUJmLVeS9uUvziWaZpAmAzVSjhk8gHrN X-Gm-Gg: AZFdTZfoeOdK+jhV0oMLTxzSBvWX7/EK+KQrrwRqTxxoQLGXb6Cp70l4L9dwhvGR+yY lVIvgBK7ZLT9rgltAYLI7LbwjwmRry6YzPJcxtzViIyKCNX2Cu8hER5ik2UPbNI/0uxK+uiJVjD hRon3Q4L0uscd/ApoAMm6sxzNOjmwyInPNMgLsTmCE5OuVKahgEj5dJEpd93ITZ/ZFiLqQogtHw H/7af6FyYxNry8ns/YFy0B3YAbIcwsfgbc4Rgp2K9dnRAxqa/9dphf4R6cZdfmSXw9MRbAsYr+V 4dQFVUVWOWurCph7Ai9ChVjxMglhshUZbldvMEkkKPE+aDOeszfMFhOIJgqY20Z0uAzdOUSVjUF 6T6T8mFhA1lHACd+GjnEf0zRWrX2Xq71XdjypfCh425Z8P4/LHtxfGb7E1aHwfmCQHQO7BhSR7T GDhRUdRh9lSKlry+aWHCQra6aS8ij3dTzaelon7yAy1e9DZRVBI1YbPfXRYu4JdNtgFDWfxxydt gvCvs1V4Q0PSQ+/ncD+m0iMWZBuktkfTquLWSJC7FDjnk7dDiLoMNs6LRQwBQ3EnAO/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) 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) Date: Thu, 03 Dec 2026 18:27:22 -0800 (PST) From: zhuorao yang To: johan@kernel.org 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 Subject: Re: [PATCH net v2] ipv6: reject permanent flag on temporary addresses Message-ID: In-Reply-To: References: <20261201122605.8080-1-alex000young@gmail.com> <69abf63fb4834193b3cea20ee57d2151@kernelpatch.local> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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 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 --- 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 i= net6_ifaddr *ifp, if (!(ifp->flags & IFA_F_TENTATIVE) || ifp->flags & IFA_F_DADFAILED) cfg->ifa_flags &=3D ~IFA_F_OPTIMISTIC; =20 + /* Temporary addresses are never permanent */ + if (ifp->flags & IFA_F_TEMPORARY) + cfg->ifa_flags &=3D ~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))