From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from r3-22.sinamail.sina.com.cn (r3-22.sinamail.sina.com.cn [202.108.3.22]) (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 4457810F2 for ; Sat, 15 Aug 2026 00:09:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.108.3.22 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786752600; cv=none; b=HX2uUezI7ZPYeEgy2znF2z/UJB3G4hidR3XKPg3AyRbRLIPXJuWKWBsaRVe+8/XcpNv2V20EjVfw8pzsFHlSw2gYyIdg8wdSaQJyhlIz3r2ACsGPskGxrBatVQbCsJDy/G/rQ7+HLZH+jQ8Dkz6/4tEpQnwigA2jM3ZnpTXWHcM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786752600; c=relaxed/simple; bh=JR9X1+1WpS/3xA0JGxPPwgFEtFlKd6HlnUn/30j3R/U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BdBQon6FSDdPhHAolpS+RNIxmh3qJ9qXO4Y4YJ6gRShe87bF/HIzCz9Yut1kr56kyLy6Roqz6NOb83lI3J6u2UNJ68Yu5lqjSWvret0KST+HvRoJFzs0ilHz+vm8p6PDbkjOPFXaXjv9YPDr5qewjzaXxYCun/DKRw42IIelTpI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b=WsQkvxYu; arc=none smtp.client-ip=202.108.3.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b="WsQkvxYu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sina.com; s=201208; t=1786752595; bh=CxxooY5SdUOma+NhqTGrv76ZoI+78gS+6Rwdf3kXNG8=; h=From:Subject:Date:Message-ID; b=WsQkvxYux3Kila9WT2o6IN8612RkwSeSowWP4N+W2mNX0k+yRS3/rnviAJT/og5Xr WrqVl3dtHVoBeA59/6wRulIT3IdcuUIz98zTUfhB3RyDMHWH0KZMhzEwq/f5Y3726w jyd7DlUo2Y6fdDU7rA0FhEWp7QIAK3/ihwcRzu5k= X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([221.216.154.155]) by sina.com (10.54.253.33) with ESMTP id 6A7FADBA00000CFE; Sat, 15 Aug 2026 08:07:25 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 6911406685476 X-SMAIL-UIID: AB95CD82DF49449BAD71CBC2AA0EF000-20260815-080725-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [net?] WARNING: refcount bug in new_device_store Date: Sat, 15 Aug 2026 08:07:14 +0800 Message-ID: <20260815000715.1133-1-hdanton@sina.com> In-Reply-To: <6a7ef6b0.10853dc7.22f513.0004.GAE@google.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit > Date: Fri, 14 Aug 2026 04:06:24 -0700 [thread overview] > Hello, > > syzbot found the following issue on: > > HEAD commit: 2f1baf1fc892 Merge tag 'trace-v7.2-rc7' of git://git.kerne.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=170d8a25580000 > kernel config: https://syzkaller.appspot.com/x/.config?x=c44651ea7dd2f307 > dashboard link: https://syzkaller.appspot.com/bug?extid=989ff6506f5c6d1ff56b > compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=148d8a25580000 #syz test --- x/drivers/net/netdevsim/bus.c +++ y/drivers/net/netdevsim/bus.c @@ -521,18 +521,18 @@ void nsim_bus_exit(void) { struct nsim_bus_dev *nsim_bus_dev, *tmp; + mutex_lock(&nsim_bus_dev_list_lock); /* Disallow using resources */ smp_store_release(&nsim_bus_enable, false); - if (refcount_dec_and_test(&nsim_bus_devs)) - complete(&nsim_bus_devs_released); - mutex_lock(&nsim_bus_dev_list_lock); list_for_each_entry_safe(nsim_bus_dev, tmp, &nsim_bus_dev_list, list) { list_del(&nsim_bus_dev->list); nsim_bus_dev_del(nsim_bus_dev); } mutex_unlock(&nsim_bus_dev_list_lock); + if (refcount_dec_and_test(&nsim_bus_devs)) + complete(&nsim_bus_devs_released); wait_for_completion(&nsim_bus_devs_released); driver_unregister(&nsim_driver); --