============================================ WARNING: possible recursive locking detected 5.16.0-rc1-syzkaller #0 Not tainted -------------------------------------------- syz-executor.1/31275 is trying to acquire lock: ffffffff90798c50 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x12c/0x570 drivers/tty/serial/serial_core.c:577 but task is already holding lock: ffffffff90798c50 (&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.1/31275: #0: ffffffff8c372a38 (tomoyo_ss){....}-{0:0}, at: tomoyo_path_perm+0x1c1/0x400 security/tomoyo/file.c:847 #1: ffffffff8bcc76f8 (remove_cache_srcu){....}-{0:0}, at: kasan_quarantine_reduce+0x41/0x200 mm/kasan/quarantine.c:274 #2: ffff88806ce07b30 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] #2: ffff88806ce07b30 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x3a/0x200 drivers/tty/serial/8250/8250_core.c:116 #3: ffffffff90798c50 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1908 #4: ffff88801abf1098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:273 stack backtrace: CPU: 1 PID: 31275 Comm: syz-executor.1 Not tainted 5.16.0-rc1-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:2956 [inline] check_deadlock kernel/locking/lockdep.c:2999 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire.cold+0x149/0x3ab kernel/locking/lockdep.c:5027 lock_acquire kernel/locking/lockdep.c:5637 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5602 __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:577 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:write_comp_data kernel/kcov.c:221 [inline] RIP: 0010:__sanitizer_cov_trace_cmp8+0x18/0x70 kernel/kcov.c:267 Code: 48 89 74 38 e8 4e 89 54 c8 20 48 89 10 c3 0f 1f 40 00 49 89 f8 bf 03 00 00 00 4c 8b 14 24 48 89 f1 65 48 8b 34 25 40 70 02 00 c3 f7 ff ff 84 c0 74 48 48 8b 86 88 15 00 00 8b b6 84 15 00 00 RSP: 0018:ffffc9000a3979c8 EFLAGS: 00000203 RAX: 0000000000000000 RBX: ffff88801c9caee0 RCX: 000000001c9caee0 RDX: ffff88803c51c240 RSI: ffff88803c51c240 RDI: 0000000000000003 RBP: ffff88809c9caee0 R08: ffff88809c9caee0 R09: 0000000000000001 R10: ffffffff8134de0e R11: 000000000000003f R12: 000000001c9caee0 R13: dffffc0000000000 R14: ffffc9000a397a40 R15: ffffea0000000000 __phys_addr+0x4e/0x140 arch/x86/mm/physaddr.c:28 virt_to_head_page include/linux/mm.h:861 [inline] qlink_to_cache mm/kasan/quarantine.c:120 [inline] qlist_free_all+0xb8/0x110 mm/kasan/quarantine.c:162 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x97/0xb0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:259 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc mm/slab.c:3323 [inline] __do_kmalloc mm/slab.c:3700 [inline] __kmalloc+0x27a/0x4d0 mm/slab.c:3711 kmalloc include/linux/slab.h:595 [inline] tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822 security_inode_getattr+0xcf/0x140 security/security.c:1334 vfs_getattr fs/stat.c:157 [inline] vfs_fstat+0x43/0xb0 fs/stat.c:182 __do_sys_newfstat+0x81/0x100 fs/stat.c:422 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:0x7f4c62ac5b35 Code: bc ff ff ff 64 c7 00 16 00 00 00 b8 ff ff ff ff c3 0f 1f 40 00 41 89 f8 89 f7 48 89 d6 41 83 f8 01 77 2a b8 05 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 03 c3 66 90 48 c7 c2 bc ff ff ff f7 d8 64 89 RSP: 002b:00007ffe80867d38 EFLAGS: 00000246 ORIG_RAX: 0000000000000005 RAX: ffffffffffffffda RBX: 0000000000000e87 RCX: 00007f4c62ac5b35 RDX: 00007ffe80867d40 RSI: 00007ffe80867d40 RDI: 0000000000000003 RBP: 0000000000000003 R08: 0000000000000001 R09: 00007ffe80868f80 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe80867d40 R13: 00007ffe80868f80 R14: 000000000000000f R15: 00007ffe80868fc0 ---------------- Code disassembly (best guess): 0: 48 89 74 38 e8 mov %rsi,-0x18(%rax,%rdi,1) 5: 4e 89 54 c8 20 mov %r10,0x20(%rax,%r9,8) a: 48 89 10 mov %rdx,(%rax) d: c3 retq e: 0f 1f 40 00 nopl 0x0(%rax) 12: 49 89 f8 mov %rdi,%r8 15: bf 03 00 00 00 mov $0x3,%edi 1a: 4c 8b 14 24 mov (%rsp),%r10 1e: 48 89 f1 mov %rsi,%rcx 21: 65 48 8b 34 25 40 70 mov %gs:0x27040,%rsi 28: 02 00 * 2a: e8 c3 f7 ff ff callq 0xfffff7f2 <-- trapping instruction 2f: 84 c0 test %al,%al 31: 74 48 je 0x7b 33: 48 8b 86 88 15 00 00 mov 0x1588(%rsi),%rax 3a: 8b b6 84 15 00 00 mov 0x1584(%rsi),%esi