[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_C01B2E4B191BB0251ABA8BBB47338C9E3508@qq.com>
Date: Wed, 6 Nov 2024 09:37:16 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+73582d08864d8268b6fd@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [sound?] INFO: task hung in snd_card_free
1. snd ctrl will add card_dev ref count and can't call close to dec it,
it is waiting for 2 to release usb dev lock.
2. usb dev lock has been locked by hung task (here is usb_disconnect), it waiting 1
to exit and release card_dev.
#syz test
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 3beb6a862e80..dd037dc4cb37 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -2605,7 +2605,8 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,
if (!(file->f_mode & FMODE_WRITE))
return -EPERM;
- usb_lock_device(dev);
+ if (!usb_trylock_device(dev))
+ return -EBUSY;
/* Reap operations are allowed even after disconnection */
switch (cmd) {
Powered by blists - more mailing lists