============================================ WARNING: possible recursive locking detected 5.15.0-syzkaller #0 Not tainted -------------------------------------------- syz-executor.0/9095 is trying to acquire lock: ffffffff90552e30 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x12c/0x570 drivers/tty/serial/serial_core.c:570 but task is already holding lock: ffffffff90552e30 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1908 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&port_lock_key); lock(&port_lock_key); *** DEADLOCK *** May be due to missing lock nesting notation 5 locks held by syz-executor.0/9095: #0: ffff88814af3a460 (sb_writers#5){.+.+}-{0:0}, at: do_pwritev fs/read_write.c:1021 [inline] #0: ffff88814af3a460 (sb_writers#5){.+.+}-{0:0}, at: __do_sys_pwritev fs/read_write.c:1068 [inline] #0: ffff88814af3a460 (sb_writers#5){.+.+}-{0:0}, at: __se_sys_pwritev fs/read_write.c:1063 [inline] #0: ffff88814af3a460 (sb_writers#5){.+.+}-{0:0}, at: __x64_sys_pwritev+0x231/0x310 fs/read_write.c:1063 #1: ffff88801b9dbfc0 (&sb->s_type->i_mutex_key#10){++++}-{3:3}, at: inode_lock include/linux/fs.h:783 [inline] #1: ffff88801b9dbfc0 (&sb->s_type->i_mutex_key#10){++++}-{3:3}, at: ext4_buffered_write_iter+0xb6/0x3b0 fs/ext4/file.c:263 #2: ffff8880121b4fb0 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline] #2: ffff8880121b4fb0 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x3a/0x200 drivers/tty/serial/8250/8250_core.c:116 #3: ffffffff90552e30 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1908 #4: ffff888073f6b098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:273 stack backtrace: CPU: 0 PID: 9095 Comm: syz-executor.0 Not tainted 5.15.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2944 [inline] check_deadlock kernel/locking/lockdep.c:2987 [inline] validate_chain kernel/locking/lockdep.c:3776 [inline] __lock_acquire.cold+0x149/0x3ab kernel/locking/lockdep.c:5015 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 uart_write+0x12c/0x570 drivers/tty/serial/serial_core.c:570 n_hdlc_send_frames+0x24b/0x490 drivers/tty/n_hdlc.c:290 tty_wakeup+0xe1/0x120 drivers/tty/tty_io.c:534 tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:51 serial8250_tx_chars+0x4f3/0xad0 drivers/tty/serial/8250/8250_port.c:1845 serial8250_handle_irq.part.0+0x328/0x3d0 drivers/tty/serial/8250/8250_port.c:1932 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1905 [inline] serial8250_default_handle_irq+0xb2/0x220 drivers/tty/serial/8250/8250_port.c:1949 serial8250_interrupt+0xfd/0x200 drivers/tty/serial/8250/8250_core.c:126 __handle_irq_event_percpu+0x303/0x8f0 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:198 [inline] handle_irq_event+0x102/0x280 kernel/irq/handle.c:215 handle_edge_irq+0x25f/0xd00 kernel/irq/chip.c:822 generic_handle_irq_desc include/linux/irqdesc.h:158 [inline] handle_irq arch/x86/kernel/irq.c:231 [inline] __common_interrupt+0x9d/0x210 arch/x86/kernel/irq.c:250 common_interrupt+0xa4/0xc0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:629 RIP: 0010:deref_stack_reg+0xee/0x150 arch/x86/kernel/unwind_orc.c:355 Code: 4c 89 e2 48 89 ef e8 71 ec f5 ff 41 89 c0 31 c0 45 85 c0 75 27 48 ba 00 00 00 00 00 fc ff df 48 89 d9 48 89 ef e8 12 f9 ff ff <48> c1 e9 03 80 3c 11 00 75 31 48 89 03 b8 01 00 00 00 48 83 c4 08 RSP: 0018:ffffc90002bff1b8 EFLAGS: 00000297 RAX: ffff8880775c8000 RBX: ffffc90002bff300 RCX: ffffc90002bff300 RDX: dffffc0000000000 RSI: ffffc90002bffcd0 RDI: ffffc90002bffcd0 RBP: ffffc90002bffcd0 R08: ffffffff8df68d5c R09: 0000000000000001 R10: fffff5200057fe63 R11: 0000000000086089 R12: ffffc90002bff2c0 R13: ffffc90002bf8000 R14: ffffc90002bff2c0 R15: ffffc90002bff2f4 unwind_next_frame+0x13e0/0x1ce0 arch/x86/kernel/unwind_orc.c:600 arch_stack_walk+0x7d/0xe0 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x8c/0xc0 kernel/stacktrace.c:121 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x83/0xb0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:259 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:3213 [inline] slab_alloc mm/slub.c:3221 [inline] kmem_cache_alloc+0x209/0x390 mm/slub.c:3226 kmem_cache_zalloc include/linux/slab.h:711 [inline] alloc_buffer_head+0x20/0x140 fs/buffer.c:3309 alloc_page_buffers+0x268/0x5f0 fs/buffer.c:832 create_empty_buffers+0x2c/0x800 fs/buffer.c:1560 ext4_block_write_begin+0xd1d/0x1140 fs/ext4/inode.c:1060 ext4_da_write_begin+0x3eb/0xad0 fs/ext4/inode.c:2969 generic_perform_write+0x205/0x510 mm/filemap.c:3746 ext4_buffered_write_iter+0x1ac/0x3b0 fs/ext4/file.c:269 ext4_file_write_iter+0x423/0x14e0 fs/ext4/file.c:681 call_write_iter include/linux/fs.h:2161 [inline] do_iter_readv_writev+0x472/0x750 fs/read_write.c:725 do_iter_write+0x188/0x710 fs/read_write.c:851 vfs_writev+0x1aa/0x630 fs/read_write.c:924 do_pwritev fs/read_write.c:1021 [inline] __do_sys_pwritev fs/read_write.c:1068 [inline] __se_sys_pwritev fs/read_write.c:1063 [inline] __x64_sys_pwritev+0x231/0x310 fs/read_write.c:1063 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f5f5684bae9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5f53dc1188 EFLAGS: 00000246 ORIG_RAX: 0000000000000128 RAX: ffffffffffffffda RBX: 00007f5f5695ef60 RCX: 00007f5f5684bae9 RDX: 0000000000000001 RSI: 00000000200014c0 RDI: 0000000000000006 RBP: 00007f5f568a5f25 R08: 0000000000002602 R09: 0000000000000000 R10: 0000000000000d00 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdc40354bf R14: 00007f5f53dc1300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: 4c 89 e2 mov %r12,%rdx 3: 48 89 ef mov %rbp,%rdi 6: e8 71 ec f5 ff callq 0xfff5ec7c b: 41 89 c0 mov %eax,%r8d e: 31 c0 xor %eax,%eax 10: 45 85 c0 test %r8d,%r8d 13: 75 27 jne 0x3c 15: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx 1c: fc ff df 1f: 48 89 d9 mov %rbx,%rcx 22: 48 89 ef mov %rbp,%rdi 25: e8 12 f9 ff ff callq 0xfffff93c * 2a: 48 c1 e9 03 shr $0x3,%rcx <-- trapping instruction 2e: 80 3c 11 00 cmpb $0x0,(%rcx,%rdx,1) 32: 75 31 jne 0x65 34: 48 89 03 mov %rax,(%rbx) 37: b8 01 00 00 00 mov $0x1,%eax 3c: 48 83 c4 08 add $0x8,%rsp