From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail115-118.sinamail.sina.com.cn (mail115-118.sinamail.sina.com.cn [218.30.115.118]) (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 1574D1E22FA for ; Sat, 25 Jan 2025 10:23:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=218.30.115.118 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737800620; cv=none; b=pnObPuryRtEdJ2mwAytW7MfjYasGjlWbzeFFFP8V8dx/6Xat/BmakNfWiOyrXh2uqslcPRkG3MUgVClYMV3HlvLpAwJnSPVUXfC2O9UTWJJLK+VPRsSDbPjGXqRpDuCNx+j+5xvuSxmHY1Jwx6aZUW/PHr328K1+4pU+m34gv+0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737800620; c=relaxed/simple; bh=RdaK3/1bn3Ea7bP6J+cKHPdBpmgpLiEfliT9nrhferE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dAohcVPkHS4aTP8kyqcgMFCVwni0fazwva6H95fO1XU+Eh+qxeTKU+iSkxkvPnY/LcVCp9PhZUJN9tizg7ZgbO3HI6tx1tASLUpAqTs9JZJtrKGfNLt94Eeq4ozo0iOZbMfHd0BVlPxdmXj9tGNV/1PHpPpncHeKs+GEk9pFqa0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; arc=none smtp.client-ip=218.30.115.118 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([113.118.69.79]) by sina.com (10.185.250.24) with ESMTP id 6794BBA0000045A4; Sat, 25 Jan 2025 18:23:30 +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: 45864110748320 X-SMAIL-UIID: 3431EB9E7CDF46E7BAC5997A63C29497-20250125-182330-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [usb?] general protection fault in status_show Date: Sat, 25 Jan 2025 18:23:23 +0800 Message-ID: <20250125102324.1822-1-hdanton@sina.com> In-Reply-To: <6789f53f.050a0220.20d369.0054.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 On Thu, 16 Jan 2025 22:14:23 -0800 > syzbot found the following issue on: > > HEAD commit: be548645527a Merge tag 'for-linus' of git://git.kernel.org.. > git tree: upstream > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12d51cb0580000 #syz test upstream master --- x/drivers/usb/usbip/vhci_sysfs.c +++ y/drivers/usb/usbip/vhci_sysfs.c @@ -76,6 +76,8 @@ static ssize_t status_show_vhci(int pdev } hcd = platform_get_drvdata(pdev); + if (!hcd || !usb_hcd_is_primary_hcd(hcd)) + return 0; vhci_hcd = hcd_to_vhci_hcd(hcd); vhci = vhci_hcd->vhci; --- x/net/core/dev.c +++ y/net/core/dev.c @@ -10260,14 +10260,19 @@ static bool from_cleanup_net(void) #endif } +static unsigned long extra_netdev_locks = 1; static void rtnl_drop_if_cleanup_net(void) { + if (extra_netdev_locks) + return; if (from_cleanup_net()) __rtnl_unlock(); } static void rtnl_acquire_if_cleanup_net(void) { + if (extra_netdev_locks) + return; if (from_cleanup_net()) rtnl_lock(); } --