From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) (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 873D125B093 for ; Thu, 14 May 2026 04:02:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778731354; cv=none; b=nQhA6oBf04h6ZgCAkGvXD1Khtid1kfoqqGZ0c6SjLHud2cAHNp7Ix3PjgStw9NKUyTofkDt9kIMfdLkCTMx04fvTCTP+Mv52x+MEmigxxY6Lsp5tMycKmSmiQKLvpcS8Fzkd8JZE617r+67bcUMbTTm2VHVcNkkXw7GODa2yVMs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778731354; c=relaxed/simple; bh=Cs4JPiX66c6OQqUQcngnhnGmmn/yZeVcI12kEL045Js=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=OcTpS2QcKjtpXxypptDmHHimX05I181tBf1ihk/+OnLCAXmpwfgcok1nzNhvz5S1Oqo5rGoBqrAAerPktiRjhgUF6cszr28GgE4C9lK/xrwZNs+S3FaQfcY8Yh32KstIFnodf3dO+CPu+9+pM08fAGiSxvDXLhLjrIZH8jfLg/s= 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.210.72 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-ot1-f72.google.com with SMTP id 46e09a7af769-7e0632c733aso15465691a34.1 for ; Wed, 13 May 2026 21:02:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778731351; x=1779336151; 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=YOHDSv6RYmclFm8PEHIr5K6p23FXuw63H2q1FyHhddU=; b=kMBclh4aKv0L75U1SDx+ZmLzSFgWl0w3wWv+b9M3KT06+wkAf9tox5CyQqRAnoNfkT dGF9ODnylkEfaryQGsVfFQr5qs9zS6krDvFrHUbwFpq2up3UIXOEBcVguew8NMDh7B3q F78oPR0arkj61+8VmVuelNtsND9GGdm0rU/exBqs8gOkaX2Mog1KvACoycwEo7A/sajp 5GfHCgFGJEL4AmKiKkW2EmJnV811Fc/KpYH8HhzEU+UF4PE41ak4kGSAO6DzKfdAuUBC W7tPZaXgmb0liTBlfWbfR/Q+BAXBCnB9uGN4GhKd3/3/StJY5Wdg43qEJXsjjyl01Ng+ i15A== X-Gm-Message-State: AOJu0YwFRRb1LJ6W8arj+Gl2iDrOqYKL1i0X8jCwgYukSBgkuGDoteCA WNLKmzythKfGihNHc+0yB1b60Wcs1BPJ43cVUg3/YdIdAHuatNtRRBT2wgPgAbRjwBKW8tiJZVi N4HXeTAe5UtqTV9o0MW9jCh/nYyV35R667HVbrXWhQFwM8L4jjTmdcfIpbQ4= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:1ca2:b0:694:96b2:9947 with SMTP id 006d021491bc7-69b7aa2c53cmr3092115eaf.13.1778731351365; Wed, 13 May 2026 21:02:31 -0700 (PDT) Date: Wed, 13 May 2026 21:02:31 -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: <6a054957.170a0220.196691.0004.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/netdev/net.git main 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