BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 181s! Showing busy workqueues and worker pools: workqueue events: flags=0x0 pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=20/256 in-flight: 29215:uhid_device_add_worker BAR(31959) pending: vmpressure_work_fn, kernfs_notify_workfn, psi_update_work, vmstat_shepherd, defense_work_handler, defense_work_handler, defense_work_handler, defense_work_handler, defense_work_handler, defense_work_handler, defense_work_handler, psi_update_work, psi_update_work, psi_update_work, cache_reap, switchdev_deferred_process_work, free_obj_work, check_corruption, kvmclock_sync_fn ====================================================== WARNING: possible circular locking dependency detected 4.20.0-rc3+ #349 Not tainted ------------------------------------------------------ syz-executor0/31951 is trying to acquire lock: 00000000472d9493 (console_owner){-.-.}, at: log_next kernel/printk/printk.c:491 [inline] 00000000472d9493 (console_owner){-.-.}, at: console_unlock+0x570/0x1190 kernel/printk/printk.c:2401 but task is already holding lock: 00000000e4c6709b (&(&pool->lock)->rlock){-.-.}, at: show_workqueue_state.cold.49+0xad0/0x159a kernel/workqueue.c:4557 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&(&pool->lock)->rlock){-.-.}: __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2d/0x40 kernel/locking/spinlock.c:144 spin_lock include/linux/spinlock.h:329 [inline] __queue_work+0x2ff/0x1440 kernel/workqueue.c:1417 queue_work_on+0x19a/0x1e0 kernel/workqueue.c:1486 queue_work include/linux/workqueue.h:512 [inline] schedule_work include/linux/workqueue.h:570 [inline] put_pwq+0x175/0x1c0 kernel/workqueue.c:1090 put_pwq_unlocked.part.27+0x34/0x70 kernel/workqueue.c:1107 put_pwq_unlocked kernel/workqueue.c:1101 [inline] destroy_workqueue+0x868/0x9c0 kernel/workqueue.c:4217 do_floppy_init drivers/block/floppy.c:4708 [inline] floppy_async_init+0x1fe4/0x213b drivers/block/floppy.c:4726 async_run_entry_fn+0x1c4/0x7f0 kernel/async.c:127 process_one_work+0xc90/0x1c40 kernel/workqueue.c:2153 worker_thread+0x17f/0x1390 kernel/workqueue.c:2296 kthread+0x35a/0x440 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 -> #3 (&pool->lock/1){..-.}: __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2d/0x40 kernel/locking/spinlock.c:144 spin_lock include/linux/spinlock.h:329 [inline] __queue_work+0x2ff/0x1440 kernel/workqueue.c:1417 queue_work_on+0x19a/0x1e0 kernel/workqueue.c:1486 queue_work include/linux/workqueue.h:512 [inline] tty_schedule_flip+0x14c/0x1d0 drivers/tty/tty_buffer.c:413 tty_flip_buffer_push+0x15/0x20 drivers/tty/tty_buffer.c:556 pty_write+0x19d/0x1f0 drivers/tty/pty.c:125 n_tty_write+0xc5b/0x11a0 drivers/tty/n_tty.c:2354 do_tty_write drivers/tty/tty_io.c:959 [inline] tty_write+0x3f1/0x880 drivers/tty/tty_io.c:1043 __vfs_write+0x119/0x9f0 fs/read_write.c:485 vfs_write+0x1fc/0x560 fs/read_write.c:549 ksys_write+0x101/0x260 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #2 (&(&port->lock)->rlock){-.-.}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x99/0xd0 kernel/locking/spinlock.c:152 tty_port_tty_get+0x20/0x80 drivers/tty/tty_port.c:287 tty_port_default_wakeup+0x15/0x40 drivers/tty/tty_port.c:47 tty_port_tty_wakeup+0x5d/0x70 drivers/tty/tty_port.c:387 uart_write_wakeup+0x44/0x60 drivers/tty/serial/serial_core.c:103 serial8250_tx_chars+0x4be/0xb60 drivers/tty/serial/8250/8250_port.c:1825 serial8250_handle_irq.part.23+0x1ee/0x280 drivers/tty/serial/8250/8250_port.c:1898 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1884 [inline] serial8250_default_handle_irq+0xc8/0x150 drivers/tty/serial/8250/8250_port.c:1914 serial8250_interrupt+0xef/0x190 drivers/tty/serial/8250/8250_core.c:125 __handle_irq_event_percpu+0x195/0xb30 kernel/irq/handle.c:149 handle_irq_event_percpu+0xa0/0x1d0 kernel/irq/handle.c:189 handle_irq_event+0xa7/0x135 kernel/irq/handle.c:206 handle_edge_irq+0x227/0x880 kernel/irq/chip.c:791 generic_handle_irq_desc include/linux/irqdesc.h:154 [inline] handle_irq+0x252/0x3d8 arch/x86/kernel/irq_64.c:78 do_IRQ+0x98/0x1c0 arch/x86/kernel/irq.c:246 ret_from_intr+0x0/0x1e arch_local_irq_restore arch/x86/include/asm/paravirt.h:761 [inline] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] _raw_spin_unlock_irqrestore+0xaf/0xd0 kernel/locking/spinlock.c:184 spin_unlock_irqrestore include/linux/spinlock.h:384 [inline] uart_write+0x4b2/0x740 drivers/tty/serial/serial_core.c:598 process_output_block drivers/tty/n_tty.c:593 [inline] n_tty_write+0x6c1/0x11a0 drivers/tty/n_tty.c:2331 do_tty_write drivers/tty/tty_io.c:959 [inline] tty_write+0x3f1/0x880 drivers/tty/tty_io.c:1043 redirected_tty_write+0xaf/0xc0 drivers/tty/tty_io.c:1064 __vfs_write+0x119/0x9f0 fs/read_write.c:485 vfs_write+0x1fc/0x560 fs/read_write.c:549 ksys_write+0x101/0x260 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (&port_lock_key){-.-.}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x99/0xd0 kernel/locking/spinlock.c:152 serial8250_console_write+0x8e8/0xb10 drivers/tty/serial/8250/8250_port.c:3266 univ8250_console_write+0x5f/0x70 drivers/tty/serial/8250/8250_core.c:586 call_console_drivers kernel/printk/printk.c:1728 [inline] console_unlock+0xb1f/0x1190 kernel/printk/printk.c:2414 vprintk_emit+0x391/0x990 kernel/printk/printk.c:1922 vprintk_default+0x28/0x30 kernel/printk/printk.c:1964 vprintk_func+0x7e/0x181 kernel/printk/printk_safe.c:398 printk+0xa7/0xcf kernel/printk/printk.c:1997 register_console+0x8df/0xcf0 kernel/printk/printk.c:2729 univ8250_console_init+0x3f/0x4b drivers/tty/serial/8250/8250_core.c:681 console_init+0x6ac/0x9dc kernel/printk/printk.c:2815 start_kernel+0x70b/0xa2b init/main.c:667 x86_64_start_reservations+0x2e/0x30 arch/x86/kernel/head64.c:472 x86_64_start_kernel+0x76/0x79 arch/x86/kernel/head64.c:451 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243 -> #0 (console_owner){-.-.}: lock_acquire+0x1ed/0x520 kernel/locking/lockdep.c:3844 console_lock_spinning_enable kernel/printk/printk.c:1591 [inline] console_unlock+0x5dd/0x1190 kernel/printk/printk.c:2411 vprintk_emit+0x391/0x990 kernel/printk/printk.c:1922 vprintk_default+0x28/0x30 kernel/printk/printk.c:1964 vprintk_func+0x7e/0x181 kernel/printk/printk_safe.c:398 printk+0xa7/0xcf kernel/printk/printk.c:1997 show_pwq kernel/workqueue.c:4464 [inline] show_workqueue_state.cold.49+0xc6c/0x159a kernel/workqueue.c:4559 wq_watchdog_timer_fn+0x6ea/0x810 kernel/workqueue.c:5571 call_timer_fn+0x272/0x920 kernel/time/timer.c:1326 expire_timers kernel/time/timer.c:1363 [inline] __run_timers+0x7e5/0xc70 kernel/time/timer.c:1682 run_timer_softirq+0x88/0xb0 kernel/time/timer.c:1697 __do_softirq+0x308/0xb7e kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x17f/0x1c0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1cb/0x760 arch/x86/kernel/apic/apic.c:1061 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:804 arch_local_irq_restore arch/x86/include/asm/paravirt.h:761 [inline] lock_acquire+0x268/0x520 kernel/locking/lockdep.c:3847 rcu_lock_acquire include/linux/rcupdate.h:223 [inline] rcu_read_lock include/linux/rcupdate.h:607 [inline] find_get_entry+0x319/0x1120 mm/filemap.c:1412 pagecache_get_page+0x12f/0xf00 mm/filemap.c:1518 find_or_create_page include/linux/pagemap.h:322 [inline] grow_dev_page fs/buffer.c:947 [inline] grow_buffers fs/buffer.c:1016 [inline] __getblk_slow fs/buffer.c:1043 [inline] __getblk_gfp+0x3aa/0xd50 fs/buffer.c:1320 __bread_gfp+0x2d/0x310 fs/buffer.c:1354 sb_bread include/linux/buffer_head.h:307 [inline] fat__get_entry+0x5a6/0xa40 fs/fat/dir.c:101 fat_get_entry fs/fat/dir.c:129 [inline] fat_search_long+0x33b/0x1570 fs/fat/dir.c:479 vfat_find+0x16d/0x1a0 fs/fat/namei_vfat.c:697 vfat_lookup+0x107/0x640 fs/fat/namei_vfat.c:711 lookup_open+0x72e/0x1b90 fs/namei.c:3213 do_last fs/namei.c:3324 [inline] path_openat+0x15e4/0x5150 fs/namei.c:3534 do_filp_open+0x255/0x380 fs/namei.c:3564 do_sys_open+0x568/0x700 fs/open.c:1063 ksys_open include/linux/syscalls.h:1279 [inline] __do_sys_creat fs/open.c:1121 [inline] __se_sys_creat fs/open.c:1119 [inline] __x64_sys_creat+0x61/0x80 fs/open.c:1119 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Chain exists of: console_owner --> &pool->lock/1 --> &(&pool->lock)->rlock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&(&pool->lock)->rlock); lock(&pool->lock/1); lock(&(&pool->lock)->rlock); lock(console_owner); *** DEADLOCK *** 8 locks held by syz-executor0/31951: #0: 000000006659f56c (sb_writers#12){.+.+}, at: sb_start_write include/linux/fs.h:1597 [inline] #0: 000000006659f56c (sb_writers#12){.+.+}, at: mnt_want_write+0x3f/0xc0 fs/namespace.c:360 #1: 00000000ce32c0f2 (&sb->s_type->i_mutex_key#20){++++}, at: inode_lock include/linux/fs.h:757 [inline] #1: 00000000ce32c0f2 (&sb->s_type->i_mutex_key#20){++++}, at: do_last fs/namei.c:3321 [inline] #1: 00000000ce32c0f2 (&sb->s_type->i_mutex_key#20){++++}, at: path_openat+0x15c4/0x5150 fs/namei.c:3534 #2: 000000006c547c96 (&sbi->s_lock){+.+.}, at: vfat_lookup+0xf1/0x640 fs/fat/namei_vfat.c:709 #3: 000000003130dfc4 (rcu_read_lock){....}, at: find_get_entry+0x2e3/0x1120 mm/filemap.c:1409 #4: 0000000045cc1ab4 ((&wq_watchdog_timer)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:173 [inline] #4: 0000000045cc1ab4 ((&wq_watchdog_timer)){+.-.}, at: call_timer_fn+0x1db/0x920 kernel/time/timer.c:1316 #5: 00000000e0f199cc (rcu_read_lock_sched){....}, at: show_workqueue_state+0x0/0x1d0 kernel/workqueue.c:4423 #6: 00000000e4c6709b (&(&pool->lock)->rlock){-.-.}, at: show_workqueue_state.cold.49+0xad0/0x159a kernel/workqueue.c:4557 #7: 000000006e6b7f21 (console_lock){+.+.}, at: console_trylock_spinning kernel/printk/printk.c:1653 [inline] #7: 000000006e6b7f21 (console_lock){+.+.}, at: vprintk_emit+0x372/0x990 kernel/printk/printk.c:1921 stack backtrace: CPU: 0 PID: 31951 Comm: syz-executor0 Not tainted 4.20.0-rc3+ #349 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x244/0x39d lib/dump_stack.c:113 print_circular_bug.isra.35.cold.54+0x1bd/0x27d kernel/locking/lockdep.c:1221 check_prev_add kernel/locking/lockdep.c:1863 [inline] check_prevs_add kernel/locking/lockdep.c:1976 [inline] validate_chain kernel/locking/lockdep.c:2347 [inline] __lock_acquire+0x3399/0x4c20 kernel/locking/lockdep.c:3341 lock_acquire+0x1ed/0x520 kernel/locking/lockdep.c:3844 console_lock_spinning_enable kernel/printk/printk.c:1591 [inline] console_unlock+0x5dd/0x1190 kernel/printk/printk.c:2411 vprintk_emit+0x391/0x990 kernel/printk/printk.c:1922 vprintk_default+0x28/0x30 kernel/printk/printk.c:1964 vprintk_func+0x7e/0x181 kernel/printk/printk_safe.c:398 printk+0xa7/0xcf kernel/printk/printk.c:1997 show_pwq kernel/workqueue.c:4464 [inline] show_workqueue_state.cold.49+0xc6c/0x159a kernel/workqueue.c:4559 wq_watchdog_timer_fn+0x6ea/0x810 kernel/workqueue.c:5571 call_timer_fn+0x272/0x920 kernel/time/timer.c:1326 ? _raw_ Lost 192 message(s)! workqueue events_long: flags=0x0 pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=2/256 pending: br_fdb_cleanup, br_fdb_cleanup workqueue events_unbound: flags=0x2 pwq 4: cpus=0-1 flags=0x4 nice=0 active=4/512 in-flight: 19157:fsnotify_connector_destroy_workfn fsnotify_connector_destroy_workfn, 18197:fsnotify_mark_destroy_workfn fsnotify_mark_destroy_workfn workqueue events_power_efficient: flags=0x80 pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=3/256 pending: gc_worker, neigh_periodic_work, check_lifetime workqueue rcu_gp: flags=0x8 pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=2/256 pending: process_srcu, process_srcu workqueue mm_percpu_wq: flags=0x8 pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=2/256 pending: vmstat_update, lru_add_drain_per_cpu BAR(31972) workqueue kblockd: flags=0x18 pwq 1: cpus=0 node=0 flags=0x0 nice=-20 active=2/256 pending: blk_mq_timeout_work, blk_mq_timeout_work workqueue dm_bufio_cache: flags=0x8 pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 pending: work_fn workqueue ipv6_addrconf: flags=0x40008 pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/1 pending: addrconf_verify_work pool 0: cpus=0 node=0 flags=0x0 nice=0 hung=182s workers=4 idle: 5373 26747 3030 pool 4: cpus=0-1 flags=0x4 nice=0 hung=53s workers=6 idle: 11285 20697 7 11019