Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp1181129ybh; Sat, 3 Aug 2019 19:58:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDQpokJEIKGfXtqZDVmOUdb8f28Ij8Urgl/bPhVslWUATufaLQ4+WgLdW9MZxSrIzcqlEe X-Received: by 2002:a62:2ad3:: with SMTP id q202mr68600311pfq.161.1564887516381; Sat, 03 Aug 2019 19:58:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564887516; cv=none; d=google.com; s=arc-20160816; b=zsdwzewGgIIv5EStZwXkoLrZkIqZHId7iFYS/VY03M3DRX6DWMhvsdiZqDu+PaPxdw 56HFXPtQJK8gunqZRiO3pbVA3fCt5iiLI0+T5sJV16uHEJJrygyeEvf2ed37noIykWER xR/N32RLWch2APR+rGwGDySeo4IGjloA3nyjDjmxc6Hk1cPUcuIAhzbKjINs7tTym66Z OjsuQz+avlgrjhWYFPtrv7d7pbda6g3eGckTYpYZgc3xgH7tTWHUVwQopO1nATZaaE+i 3WRFgD+mk/lWIloNQuo2iqzbdGxd4D5GWq5GBit2ye9X4G2HKMO4je+8klgRhTLldIID sItg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=gNJE7fHMQE7PHFlsIIxKGSWlzAltyKuhSVptR6xGXUE=; b=pQlstdP2irhu595kRC8Lem9njqFzfmsOJEdvyG7tJgSK9F9Sow6iqZghUHFWhlAKCQ DIYhP+dpgqJRZrNqB9vWmo4//D+tWJMwJ/VBV31BKX5CJnAZBEbPGDArLFKmtoPc29OH JEnvQTui3cwD/fS/GDaZGtdzxF4EOegqPjK+42eVGaIC4XGpFyUDhfnSzrnWf2p4ju7D 4JwUj/8PpC094hwLKRULWGUmljyFSmBY29zHkJ8oGtWna3GOz3qpPzgWnnD1aCTlWPnq l9J9x7LsJefIKxnUnJed8NiGqsMZ+kfi124P8Ti5n2TUS8yxzltqrbi2SJwY+xwacjh3 DqZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n18si38663205plp.215.2019.08.03.19.58.21; Sat, 03 Aug 2019 19:58:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437074AbfHBUvT (ORCPT + 99 others); Fri, 2 Aug 2019 16:51:19 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:42170 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1729659AbfHBUvT (ORCPT ); Fri, 2 Aug 2019 16:51:19 -0400 Received: (qmail 6861 invoked by uid 2102); 2 Aug 2019 16:51:18 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 2 Aug 2019 16:51:18 -0400 Date: Fri, 2 Aug 2019 16:51:18 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Oliver Neukum , syzbot cc: andreyknvl@google.com, , Kernel development list , USB list , , , Subject: Re: possible deadlock in open_rio In-Reply-To: <00000000000088af91058f0fe377@google.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 1 Aug 2019, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit: 7f7867ff usb-fuzzer: main usb gadget fuzzer driver > git tree: https://github.com/google/kasan.git usb-fuzzer > console output: https://syzkaller.appspot.com/x/log.txt?x=136b6aec600000 > kernel config: https://syzkaller.appspot.com/x/.config?x=792eb47789f57810 > dashboard link: https://syzkaller.appspot.com/bug?extid=7bbcbe9c9ff0cd49592a > compiler: gcc (GCC) 9.0.0 20181231 (experimental) > > Unfortunately, I don't have any reproducer for this crash yet. > > IMPORTANT: if you fix the bug, please add the following tag to the commit: > Reported-by: syzbot+7bbcbe9c9ff0cd49592a@syzkaller.appspotmail.com > > ====================================================== > WARNING: possible circular locking dependency detected > 5.3.0-rc2+ #23 Not tainted > ------------------------------------------------------ > syz-executor.2/20386 is trying to acquire lock: > 00000000772249c6 (rio500_mutex){+.+.}, at: open_rio+0x16/0xc0 > drivers/usb/misc/rio500.c:64 > > but task is already holding lock: > 00000000d3e8f4b9 (minor_rwsem){++++}, at: usb_open+0x23/0x270 > drivers/usb/core/file.c:39 > > which lock already depends on the new lock. > > > the existing dependency chain (in reverse order) is: > > -> #1 (minor_rwsem){++++}: > down_write+0x92/0x150 kernel/locking/rwsem.c:1500 > usb_register_dev drivers/usb/core/file.c:187 [inline] > usb_register_dev+0x131/0x6a0 drivers/usb/core/file.c:156 > probe_rio.cold+0x53/0x21d drivers/usb/misc/rio500.c:468 This was caused by Oliver's commit 3864d33943b4 ("USB: rio500: refuse more than one device at a time"). It added mutex_lock(&rio500_mutex); to probe_rio(). I guess it will be necessary to add another mutex to fix this. Alan Stern