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=1795036771; b=qRFsm3Qh8KoSmXidFBdTViG1pNCr7WdiW8ZA0VX0bJaeIfIeXCni1+y4hY9jH4bFOQJf WH8Qj2phlAm66G3aILybCcQjPLdfgco0ZM+1T/QzFedbH7/mIFgkmEbAtYuAuiLVv2iRR qBIeFdoGLQAQRGvI/5GcFyjIlctw+O7kVeN9lsD1+M6/Iol+PIUSUS/ErrrzyBce3hh1R ONkQa7XEDH05i9Q39DqS/GJNEV68i2mE1hWa7zwpLlfh7dZBfUYvQY9ZkW4krAes5XHRy OWQOvc0bH4dPsS6YcULqq1a/BrTsEcYPDblc9DvGTPIl2lvC2hM0xGtEDGDIVWrwovA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795036771; 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=Y1ii0+CddtU+YBIxUheq+Ifimqu0N+f5R1Ad4BYLXAY=; b=E1TT+++Hfv35WsjuA6LRwdqpf6MZj6W1NXgdLcO/fqWcRZx06D9PDM4veDuxqUMSLlCH wCyTdAwrT2LbqWsyXBaB9p8j0AtU0TDdfnmVTFR4mnIm396zYsHZhK2fV2EI0S12aCwYs RowZJaUPLloMbUCn+v8PsMZ85ZlXYJoifVjzrsnNeIbApxnRGZJLKtouwG6txix+IlKPB GQRfwnbjAEFkxB2gaCztKZAr/lVdXwzY9TBxns50yTgUdRQMhFWRNZ6wcwoFvks9zHdKp qCW7tlDqyRrm/33MFMc35Nu6Ouyg8jZG8frwpLAXPxq6bFIBYnvBUfTT84MaH3bClOA== 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=wdpchWd4; 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 AD036606A31C; Wed, 18 Nov 2026 21:19:31 +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=wdpchWd4 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 100521F000C4; Wed, 18 Nov 2026 21:19:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795036771; bh=Y1ii0+CddtU+YBIxUheq+Ifimqu0N+f5R1Ad4BYLXAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=wdpchWd4v/5bJmx7Vxl3tEVB8EtGJfvNTv+BrYYH4lN3P94pXa7zz0tCriLGkfISa h6kL4rq/a5b0YQb/gNagFjEgOIrMtuVo1XfJ5Jw3qLDSI4/IoBoV7jAaGyVw9Gmy1Q j+T+8tTVqazVcWx7wOtTqA0Ymo1alCr4us66xYmQ= 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 6.6 1178/3318] ipv6: do not restart DAD for a dead ifaddr Date: Wed, 18 Nov 2026 15:30:00 +0100 Message-ID: <20261118150355.478386179@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150313.527275416@linuxfoundation.org> References: <20261118150313.527275416@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-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 0148e6169c3c8..1c8309ae20c35 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -2162,6 +2162,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; @@ -2200,11 +2201,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