From nobody Fri Jun 19 22:20:52 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D7EA2DCBFA; Tue, 21 Apr 2026 07:50:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776757850; cv=none; b=sayv2fmc0GOTxo51obbwVrf7/kL7HOHm/FdQOyI9iuy2LfaISjm42m/H+/vKOAMWPvljWvB5xJY2KJURNa1IH6TFM/FcbWwMkf7LrzxFjRqJm+Xx9BBdq2CsxnxOk/+B+VV24Cgs/9B3+yPz7j2G59lMEu+xHFOF8gZN4TCBe8g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776757850; c=relaxed/simple; bh=aeWhnC9tAHzVsNg95d/rE5/50qgT5p8VRNTcVskt38w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SU7M7BCdAfP8qBxRSaudKbLHH3sZKD4SLrJBGztoImYZNRmb1EAtSgo4wPqNFtcC7w1mnzNz/H/gt05eldLNuO4Zb33nXMu4Z5zLU+5fHS6seDqYQ4mVZhOj4ExmO/ObrHleuvM3/TcC+It8iAxgZKPWoxcCEvkpYRr3MMUctHc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: cb177f943d5611f1aa26b74ffac11d73-20260421 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:fd870df1-9930-49f8-9611-d931ae5b2f3f,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:e7bac3a,CLOUDID:085546683e1194800e55b250578fc7eb,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|850|898,TC:nil,Content:0|15|50 ,EDM:-3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,O SA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: cb177f943d5611f1aa26b74ffac11d73-20260421 X-User: lilinmao@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1769261180; Tue, 21 Apr 2026 15:50:40 +0800 From: Linmao Li To: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Linmao Li Subject: [PATCH net v2] ipv6: addrconf: skip ERRDAD transition when address already DEAD Date: Tue, 21 Apr 2026 15:50:33 +0800 Message-Id: <20260421075033.1110816-1-lilinmao@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20260420032842.1063277-1-lilinmao@kylinos.cn> References: <20260420032842.1063277-1-lilinmao@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" addrconf_dad_end() transitions ifp->state from DAD to POSTDAD under ifp->lock and releases the lock. addrconf_dad_failure() takes ifp->lock again with the spin_lock_bh() following the net_info_ratelimited() duplicate-address log. A concurrent ipv6_del_addr() can acquire the lock in that window, set ifp->state to DEAD and run list_del_rcu(&ifp->if_list). addrconf_dad_failure() then overwrites DEAD with ERRDAD at errdad: and schedules a new dad_work. The work calls ipv6_del_addr() again, hitting the already-poisoned list entry: general protection fault: 0000 [#1] SMP NOPTI CPU: 4 PID: 217 Comm: kworker/4:1 Workqueue: ipv6_addrconf addrconf_dad_work RIP: 0010:ipv6_del_addr+0xe9/0x280 RAX: dead000000000122 Call Trace: addrconf_dad_stop+0x113/0x140 addrconf_dad_work+0x28c/0x430 process_one_work+0x1eb/0x3b0 worker_thread+0x4d/0x400 kthread+0x104/0x140 ret_from_fork+0x35/0x40 Bail out at errdad: when ifp->state is already DEAD. The existing in6_ifa_put() releases the reference taken for this invocation. Fixes: c15b1ccadb32 ("ipv6: move DAD and addrconf_verify processing to work= queue") Signed-off-by: Linmao Li --- net/ipv6/addrconf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 5476b6536eb7..14b1ab43da87 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -2227,6 +2227,12 @@ void addrconf_dad_failure(struct sk_buff *skb, struc= t inet6_ifaddr *ifp) =20 errdad: /* transition from _POSTDAD to _ERRDAD */ + if (ifp->state =3D=3D INET6_IFADDR_STATE_DEAD) { + /* ipv6_del_addr() already removed ifp while lock was dropped */ + spin_unlock_bh(&ifp->lock); + in6_ifa_put(ifp); + return; + } ifp->state =3D INET6_IFADDR_STATE_ERRDAD; spin_unlock_bh(&ifp->lock); =20 --=20 2.25.1