From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f69.google.com (mail-oo1-f69.google.com [209.85.161.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70FF83D669C for ; Thu, 14 May 2026 08:24:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.69 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778747080; cv=none; b=abe5+5cwHp4Gz3XrRS+35uzeLbfd283q4TlZJMonSAKeYu4b11OMAKnXYKuLtXJp8nf4V45XJ0YjjkqqsBS8NW3AIPThL12UCdQ0WQ+Wtzaaqrzc2wenqYl2TBtC/UfidEQe3kKrAV/wtY/06MZ9/kln7kEljD45AvjEux15iO4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778747080; c=relaxed/simple; bh=7psORCRTzFcAVevEPYcmZPXIusp8OYK9MT98PHUeqK8=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=MriFFTnLmsNCJeLTcUUS0XjKBP+Oc6cxzfmA9mVFTrHwJ1/16lu7LAPq1xHvDVuNu2yZA/sMKTMNuJXs2MrmSwsaHrSWtfyEotQbN1JxLU1LIBNjY4Fns6z5d5D+076oLi/44yyvLcqgvmk9qcVFoi53AxuVfRfPMNqecoL8qEk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f69.google.com with SMTP id 006d021491bc7-69b3bf528c9so8369070eaf.0 for ; Thu, 14 May 2026 01:24:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778747078; x=1779351878; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ErXShbTLZ7KKVjZBNq9g1VTIrl8Lfh0wF+BFozi2FV4=; b=P+95M8js0FzHAhYKeLn4qyUIrehuESFnoMTeiFoEQaTduRNMfYwb1I6j9rKdwZ0My/ ZHFvy4OUpCdkBq7WJMGNhHtu+4ojL+RTtacdAVxPQPPwcTqVYlrF/VsOH8wDc7ETqhsG oFFMm5CnX+WUovmbwDJ6IoE2N1AsAvpFo128X+9l7omQS60Ms79UccGVkj1MJAZt736g HNZwMlTosc2vHdocMd9hB6RezLfMvEpEtnLDKPMvAO9Oq7sq/AVTEETxAbsFhx4TMg5C NW/OwOuMcgtGWObsZqKUTCTTJXEQ+bHve4RdYNr8W6t3QAQ+/RgmQWcCwICIoHZCp4yO Uv/g== X-Gm-Message-State: AOJu0YyI+lcWDdL7QgLV59vQoVedEYIMIPph3Got56X+4U14vFUR6r3T ls/GqGAuyb9kUO3hdLsX55ycV0eRKpYLA6mk8tPHP8LQHk5nZxPpSYWk9TBYKO/tnztrSk1cwrJ 5azCbGlEsOWRCoUHqhXdkPr85q+S/K04SvEo4l8oaa/N8NAiwJotCfD5zjR0= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a4a:de08:0:b0:696:aedf:bd53 with SMTP id 006d021491bc7-69b87d2fb32mr1108458eaf.9.1778747078373; Thu, 14 May 2026 01:24:38 -0700 (PDT) Date: Thu, 14 May 2026 01:24:38 -0700 In-Reply-To: <6a00e81a.170a0220.1c0296.0218.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a0586c6.050a0220.d11c8.0005.GAE@google.com> Subject: Forwarded: [syzbot] test [PATCH net v2] ipv6: addrconf: skip autoconf on unregistering devices From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [syzbot] test [PATCH net v2] ipv6: addrconf: skip autoconf on unregistering devices Author: raoxu@uniontech.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci From: Xu Rao Subject: [PATCH net v2] ipv6: addrconf: skip autoconf on unregistering devices syzbot reports that unregister_netdevice() can wait forever for a netdevsim device whose reference count never drops to zero. The leaked reference is held by an IPv6 local route created from addrconf. A late NETDEV_CHANGE notification can still reach addrconf_notify() after the device has entered NETREG_UNREGISTERING. The handler can then run automatic address configuration, add a link-local address and install its host route after unregister teardown has already started. The route nexthop takes a netdev reference in fib6_nh_init(), and there might not be a later ifdown pass to remove the newly created address and route. Do not run MTU, UP or CHANGE based IPv6 autoconfiguration once the device is unregistering. Keep NETDEV_DOWN and NETDEV_UNREGISTER handling unchanged so the teardown path can still remove existing IPv6 state. Reported-by: syzbot+e2af46126e0644cbebdd@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=e2af46126e0644cbebdd Signed-off-by: Xu Rao --- v2: - Drop READ_ONCE() around dev->reg_state. addrconf_notify() is called from the netdevice notifier path, so a plain load is sufficient. - Do not add a Fixes tag. The issue does not appear to be caused by a single commit, but by a long-standing unregister-time lifecycle gap. net/ipv6/addrconf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 5476b6536eb7..a517e57cf86a 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -3666,6 +3666,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, break; case NETDEV_CHANGEMTU: + if (dev->reg_state == NETREG_UNREGISTERING) + break; + /* if MTU under IPV6_MIN_MTU stop IPv6 on this interface. */ if (dev->mtu < IPV6_MIN_MTU) { addrconf_ifdown(dev, dev != net->loopback_dev); @@ -3691,12 +3694,15 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, fallthrough; case NETDEV_UP: case NETDEV_CHANGE: + if (dev->reg_state == NETREG_UNREGISTERING) + break; + if (idev && idev->cnf.disable_ipv6) break; if (dev->priv_flags & IFF_NO_ADDRCONF) { if (event == NETDEV_UP && !IS_ERR_OR_NULL(idev) && dev->flags & IFF_UP && dev->flags & IFF_MULTICAST) ipv6_mc_up(idev); break; } -- 2.50.1