usb usb2: usbfs: process 21065 (syz-executor.2) did not claim interface 0 before use ====================================================== WARNING: possible circular locking dependency detected 4.14.198-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/21061 is trying to acquire lock: ("%s"hdev->name#2){+.+.}, at: [] start_flush_work kernel/workqueue.c:2860 [inline] ("%s"hdev->name#2){+.+.}, at: [] flush_work+0x387/0x770 kernel/workqueue.c:2892 but task is already holding lock: (&hdev->lock){+.+.}, at: [] hci_dev_do_close+0x210/0xc50 net/bluetooth/hci_core.c:1607 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&hdev->lock){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 hci_cc_write_scan_enable net/bluetooth/hci_event.c:360 [inline] hci_cmd_complete_evt+0x4f1a/0x9590 net/bluetooth/hci_event.c:2839 hci_event_packet+0x1a5d/0x7d1d net/bluetooth/hci_event.c:5321 hci_rx_work+0x3e6/0x970 net/bluetooth/hci_core.c:4244 process_one_work+0x793/0x14a0 kernel/workqueue.c:2116 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250 kthread+0x30d/0x420 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 -> #1 ((&hdev->rx_work)){+.+.}: process_one_work+0x736/0x14a0 kernel/workqueue.c:2092 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250 kthread+0x30d/0x420 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 -> #0 ("%s"hdev->name#2){+.+.}: lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 start_flush_work kernel/workqueue.c:2861 [inline] flush_work+0x3ac/0x770 kernel/workqueue.c:2892 __cancel_work_timer+0x321/0x460 kernel/workqueue.c:2964 hci_conn_del+0x43/0x620 net/bluetooth/hci_conn.c:575 hci_conn_hash_flush+0x189/0x220 net/bluetooth/hci_conn.c:1377 hci_dev_do_close+0x542/0xc50 net/bluetooth/hci_core.c:1620 hci_rfkill_set_block net/bluetooth/hci_core.c:2050 [inline] hci_rfkill_set_block+0x94/0xe0 net/bluetooth/hci_core.c:2037 rfkill_set_block+0x1b2/0x4a0 net/rfkill/core.c:337 rfkill_fop_write+0x1b6/0x3c0 net/rfkill/core.c:1233 do_loop_readv_writev fs/read_write.c:698 [inline] do_loop_readv_writev fs/read_write.c:682 [inline] do_iter_write+0x3da/0x550 fs/read_write.c:956 vfs_writev+0x125/0x290 fs/read_write.c:999 do_writev+0xfc/0x2c0 fs/read_write.c:1034 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb other info that might help us debug this: Chain exists of: "%s"hdev->name#2 --> (&hdev->rx_work) --> &hdev->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&hdev->lock); lock((&hdev->rx_work)); lock(&hdev->lock); lock("%s"hdev->name#2); *** DEADLOCK *** 3 locks held by syz-executor.1/21061: #0: (rfkill_global_mutex){+.+.}, at: [] rfkill_fop_write+0xbf/0x3c0 net/rfkill/core.c:1225 #1: (&hdev->req_lock){+.+.}, at: [] hci_dev_do_close+0xfd/0xc50 net/bluetooth/hci_core.c:1576 #2: (&hdev->lock){+.+.}, at: [] hci_dev_do_close+0x210/0xc50 net/bluetooth/hci_core.c:1607 stack backtrace: CPU: 0 PID: 21061 Comm: syz-executor.1 Not tainted 4.14.198-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x283 lib/dump_stack.c:58 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1905 [inline] check_prevs_add kernel/locking/lockdep.c:2022 [inline] validate_chain kernel/locking/lockdep.c:2464 [inline] __lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 start_flush_work kernel/workqueue.c:2861 [inline] flush_work+0x3ac/0x770 kernel/workqueue.c:2892 __cancel_work_timer+0x321/0x460 kernel/workqueue.c:2964 hci_conn_del+0x43/0x620 net/bluetooth/hci_conn.c:575 hci_conn_hash_flush+0x189/0x220 net/bluetooth/hci_conn.c:1377 hci_dev_do_close+0x542/0xc50 net/bluetooth/hci_core.c:1620 hci_rfkill_set_block net/bluetooth/hci_core.c:2050 [inline] hci_rfkill_set_block+0x94/0xe0 net/bluetooth/hci_core.c:2037 rfkill_set_block+0x1b2/0x4a0 net/rfkill/core.c:337 rfkill_fop_write+0x1b6/0x3c0 net/rfkill/core.c:1233 do_loop_readv_writev fs/read_write.c:698 [inline] do_loop_readv_writev fs/read_write.c:682 [inline] do_iter_write+0x3da/0x550 fs/read_write.c:956 vfs_writev+0x125/0x290 fs/read_write.c:999 do_writev+0xfc/0x2c0 fs/read_write.c:1034 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x45de59 RSP: 002b:00007f1ec7343c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 000000000003b900 RCX: 000000000045de59 RDX: 0000000000000002 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 000000000118bf60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bf2c R13: 00007fff5ae79eef R14: 00007f1ec73449c0 R15: 000000000118bf2c REISERFS warning (device loop4): super-6505 reiserfs_getopt: head of option "noattrs" is only correct Dev loop3: unable to read RDB block 1 loop3: unable to read partition table loop3: partition table beyond EOD, truncated loop_reread_partitions: partition scan of loop3 () failed (rc=-5) Dev loop3: unable to read RDB block 1 loop3: unable to read partition table loop3: partition table beyond EOD, truncated loop_reread_partitions: partition scan of loop3 () failed (rc=-5) Dev loop3: unable to read RDB block 1 loop3: unable to read partition table loop3: partition table beyond EOD, truncated print_req_error: I/O error, dev loop3, sector 0 Buffer I/O error on dev loop3, logical block 0, async page read ldm_validate_partition_table(): Disk read failed. Dev loop3: unable to read RDB block 0 loop3: unable to read partition table loop3: partition table beyond EOD, truncated Dev loop3: unable to read RDB block 1 loop3: unable to read partition table loop3: partition table beyond EOD, truncated loop_reread_partitions: partition scan of loop3 () failed (rc=-5) Dev loop3: unable to read RDB block 1 loop3: unable to read partition table loop3: partition table beyond EOD, truncated loop_reread_partitions: partition scan of loop3 () failed (rc=-5) Dev loop3: unable to read RDB block 1 loop3: unable to read partition table loop3: partition table beyond EOD, truncated loop_reread_partitions: partition scan of loop3 () failed (rc=-5) ip_tables: iptables: counters copy to user failed while replacing table audit: type=1326 audit(1602940745.730:121): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=21371 comm="syz-executor.3" exe="/root/syz-executor.3" sig=31 arch=c000003e syscall=228 compat=0 ip=0x460cba code=0x1000000 ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table EXT4-fs (loop4): warning: mounting unchecked fs, running e2fsck is recommended ip_tables: iptables: counters copy to user failed while replacing table EXT4-fs (loop4): Errors on filesystem, clearing orphan list. ip_tables: iptables: counters copy to user failed while replacing table EXT4-fs (loop4): mounted filesystem without journal. Opts: usrjquota=,sb=0x0000000000000000,,errors=continue arp_tables: arptables: counters copy to user failed while replacing table EXT4-fs (loop4): warning: mounting unchecked fs, running e2fsck is recommended arp_tables: arptables: counters copy to user failed while replacing table EXT4-fs (loop4): Errors on filesystem, clearing orphan list. EXT4-fs (loop4): mounted filesystem without journal. Opts: usrjquota=,sb=0x0000000000000000,,errors=continue gfs2: not a GFS2 filesystem arp_tables: arptables: counters copy to user failed while replacing table audit: type=1326 audit(1602940746.510:122): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=21371 comm="syz-executor.3" exe="/root/syz-executor.3" sig=31 arch=c000003e syscall=228 compat=0 ip=0x460cba code=0x1000000 arp_tables: arptables: counters copy to user failed while replacing table gfs2: not a GFS2 filesystem EXT4-fs (loop4): warning: mounting unchecked fs, running e2fsck is recommended EXT4-fs (loop4): Errors on filesystem, clearing orphan list. arp_tables: arptables: counters copy to user failed while replacing table EXT4-fs (loop4): mounted filesystem without journal. Opts: usrjquota=,sb=0x0000000000000000,,errors=continue gfs2: not a GFS2 filesystem EXT4-fs (loop4): warning: mounting unchecked fs, running e2fsck is recommended gfs2: not a GFS2 filesystem EXT4-fs (loop4): Errors on filesystem, clearing orphan list. EXT4-fs (loop4): mounted filesystem without journal. Opts: usrjquota=,sb=0x0000000000000000,,errors=continue