From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795052783; b=GpItPUbQSGllLr8wo2amUs+2+/MtO7kEqX00uiPLAc1H4Bz/owoOoysdt/3uqM6RX/7w 9uZ8E7zqPVLIf5+lSC3Fu13pNOzET8bYJoWxjEnPsYdqhLZahHughoCLsC/RWePU78xkZ fRWnteVio23ypPWGp3yaSKiFcnW6gEN/OT8/R76X5HcsPOkKIiEElqts+JzovCYOTHXtW cJinzGJCxeokulBLgaDl5lh4K1sx1Iy/11sAiSUNHWsSDQeprkwWcPGaoo9d0ZK9UrB/e DdUHstZSxM9t0hBFMckKZtixkIrVt+O6/DHqs3phwr+83gfa8u3QtQPmq6HyeXDMzrA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795052783; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=1N8DX+mQq83C4FuiOfmWZHB8RN3V12qOQfsi7vawM98=; b=td9nOY65Rpt1JAgrVHFw8Cd69tarAnqtXWaQFtFKHcvEH0oGULNfU6sp0gWtVQ+JYSFq 6dih7Fpb56wWe6LxXTEWIVoSkDfu84RdUUtjXPdG9pbEqkrUkpTA3IaGE1YInwLDFi0jT X0eDBZI0f61Dbj+O6cKqLJdobY0Ge3wFUIeFKwbjDTiEfSA0tyy74BDwqd4DrvgZe/wUt 5BT93PwUrxktQeAZP4ju31ivnDIfPlRFBT4YGPjRx3CgvDA5E8W7oiFsLB9OuB9sAgltN peoOIxgQxZ3B4oszgqbFMA22gOUCYCeATkuhZYqevjV01FVxxJh0ezfKJFZdH6oVgeQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=RKvA299I; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6D4D606A320; Thu, 19 Nov 2026 01:46:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=RKvA299I Received: by smtp.kernel.org (Postfix) with ESMTPSA id 152441F000C4; Thu, 19 Nov 2026 01:46:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795052783; bh=1N8DX+mQq83C4FuiOfmWZHB8RN3V12qOQfsi7vawM98=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RKvA299I2mLskg/kWJgmSNmww89tdPWyWxJAexQmsRxS6jSrvygfLO/BoHYvXo6NA GH9YGgp7YSkTvmnJTkeNVduJRmMVqlrQXsdtVhgk65MKO2xcAn5P1GQ2Snh8flq4sa 2+UvlQ8fFcgB8Xfc58L9q0YpVdhlv7lsT1S2VfIk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sashiko , Daehyeon Ko <4ncienth@gmail.com>, Ido Schimmel , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 0680/2214] ipv6: do not restart DAD for a dead ifaddr Date: Wed, 18 Nov 2026 15:39:16 +0100 Message-ID: <20261118150038.981517098@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150009.797899913@linuxfoundation.org> References: <20261118150009.797899913@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Daehyeon Ko <4ncienth@gmail.com> [ Upstream commit ffb668669ce4144347973d8b2fad449e9be0563d ] addrconf_dad_failure() can create a stable-privacy replacement without RTNL. After ipv6_add_addr() publishes it, addrconf_ifdown() can mark the new ifaddr DEAD, clear its route, and unlink it before the recovery path takes ifp2->lock. The recovery path then unconditionally changes the state back to PREDAD and queues delayed DAD work. The MTU teardown path can leave IF_READY set. For an optimistic address, addrconf_dad_begin() can consequently pass the cleared NULL route to ip6_ins_rt(). This follow-on was found by source review and was not separately triggered at runtime. The new ifaddr is already initialized in PREDAD. Under ifp2->lock, record the retry and queue DAD only if teardown has not changed the state to DEAD. If teardown wins after this check, the work observes DEAD and exits without reviving the address. This complements the existing lock_errdad check that preserves the original ifaddr's DEAD state after the same function reacquires its lock. Fixes: 5f40ef77adb2 ("ipv6: do retries on stable privacy addresses") Cc: stable@vger.kernel.org Reported-by: Sashiko Closes: https://lore.kernel.org/r/179161099408.434549.14449036924552933828@kernel.org Link: https://lore.kernel.org/r/20260513025509.3776405-1-lilinmao@kylinos.cn Signed-off-by: Daehyeon Ko <4ncienth@gmail.com> Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261015050651.1841557-5-4ncienth@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/ipv6/addrconf.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index f7889ada42125..b4ad40641d249 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -2144,6 +2144,7 @@ void addrconf_dad_failure(struct sk_buff *skb, struct inet6_ifaddr *ifp) ifp->idev->dev->name, &ifp->addr, eth_hdr(skb)->h_source); if (ifp->flags & IFA_F_STABLE_PRIVACY) { + bool start_dad = false; struct in6_addr new_addr; struct inet6_ifaddr *ifp2; int retries = ifp->stable_privacy_retry + 1; @@ -2182,11 +2183,14 @@ void addrconf_dad_failure(struct sk_buff *skb, struct inet6_ifaddr *ifp) goto lock_errdad; spin_lock_bh(&ifp2->lock); - ifp2->stable_privacy_retry = retries; - ifp2->state = INET6_IFADDR_STATE_PREDAD; + if (ifp2->state != INET6_IFADDR_STATE_DEAD) { + ifp2->stable_privacy_retry = retries; + start_dad = true; + } spin_unlock_bh(&ifp2->lock); - addrconf_mod_dad_work(ifp2, net->ipv6.sysctl.idgen_delay); + if (start_dad) + addrconf_mod_dad_work(ifp2, net->ipv6.sysctl.idgen_delay); in6_ifa_put(ifp2); lock_errdad: spin_lock_bh(&ifp->lock); -- 2.53.0