============================================
WARNING: possible recursive locking detected
5.15.0-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.1/19253 is trying to acquire lock:
ffffffff9055d5d0 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x12c/0x570 drivers/tty/serial/serial_core.c:577
but task is already holding lock:
ffffffff9055d5d0 (&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
6 locks held by syz-executor.1/19253:
#0: ffff88814acd6c28 (&mdev->req_queue_mutex){+.+.}-{3:3}, at: v4l2_release+0x1e2/0x3b0 drivers/media/v4l2-core/v4l2-dev.c:455
#1: ffff88814acd6cc8 (&dev->dev_mutex){+.+.}-{3:3}, at: vim2m_release+0xb6/0x140 drivers/media/test-drivers/vim2m.c:1244
#2: ffff8880393434c8 (&q->mmap_lock){+.+.}-{3:3}, at: vb2_core_queue_release+0x2c/0x70 drivers/media/common/videobuf2/videobuf2-core.c:2432
#3: ffff88801914c0b0 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline]
#3: ffff88801914c0b0 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x3a/0x200 drivers/tty/serial/8250/8250_core.c:116
#4: ffffffff9055d5d0 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1908
#5: ffff888038391098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:273
stack backtrace:
CPU: 1 PID: 19253 Comm: syz-executor.1 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:2959 [inline]
check_deadlock kernel/locking/lockdep.c:3002 [inline]
validate_chain kernel/locking/lockdep.c:3791 [inline]
__lock_acquire.cold+0x149/0x3ab kernel/locking/lockdep.c:5030
lock_acquire kernel/locking/lockdep.c:5640 [inline]
lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5605
__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:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x38/0x70 kernel/locking/spinlock.c:194
Code: 74 24 10 e8 1a f6 20 f8 48 89 ef e8 62 6c 21 f8 81 e3 00 02 00 00 75 25 9c 58 f6 c4 02 75 2d 48 85 db 74 01 fb bf 01 00 00 00 83 36 14 f8 65 8b 05 fc 8d c6 76 85 c0 74 0a 5b 5d c3 e8 80 1b
RSP: 0018:ffffc90003ddf838 EFLAGS: 00000206
RAX: 0000000000000006 RBX: 0000000000000200 RCX: 1ffffffff1fb1bee
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001
RBP: ffffffff90474f18 R08: 0000000000000001 R09: ffffffff8fd43ac7
R10: 0000000000000001 R11: 0000000000000000 R12: 1ffffffff208e9e2
R13: 0000000000000000 R14: dead000000000100 R15: dffffc0000000000
__debug_check_no_obj_freed lib/debugobjects.c:1002 [inline]
debug_check_no_obj_freed+0x20c/0x420 lib/debugobjects.c:1023
__vunmap+0x2be/0xb70 mm/vmalloc.c:2618
__vfree+0x3c/0xd0 mm/vmalloc.c:2680
vfree+0x5a/0x90 mm/vmalloc.c:2711
vb2_vmalloc_put drivers/media/common/videobuf2/videobuf2-vmalloc.c:68 [inline]
vb2_vmalloc_put+0x8a/0xc0 drivers/media/common/videobuf2/videobuf2-vmalloc.c:63
__vb2_buf_mem_free+0x10d/0x230 drivers/media/common/videobuf2/videobuf2-core.c:266
__vb2_free_mem drivers/media/common/videobuf2/videobuf2-core.c:492 [inline]
__vb2_queue_free+0x728/0x9a0 drivers/media/common/videobuf2/videobuf2-core.c:537
vb2_core_queue_release+0x5e/0x70 drivers/media/common/videobuf2/videobuf2-core.c:2433
v4l2_m2m_ctx_release+0x26/0x30 drivers/media/v4l2-core/v4l2-mem2mem.c:1217
vim2m_release+0xe0/0x140 drivers/media/test-drivers/vim2m.c:1245
v4l2_release+0x22c/0x3b0 drivers/media/v4l2-core/v4l2-dev.c:456
__fput+0x286/0x9f0 fs/file_table.c:280
task_work_run+0xdd/0x1a0 kernel/task_work.c:164
exit_task_work include/linux/task_work.h:32 [inline]
do_exit+0xc14/0x2b40 kernel/exit.c:832
do_group_exit+0x125/0x310 kernel/exit.c:929
get_signal+0x47d/0x21d0 kernel/signal.c:2820
arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868
handle_signal_work kernel/entry/common.c:148 [inline]
exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207
__syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline]
syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300
do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f5b0e42fae9
Code: Unable to access opcode bytes at RIP 0x7f5b0e42fabf.
RSP: 002b:00007f5b0b9a5218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00007f5b0e542f68 RCX: 00007f5b0e42fae9
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f5b0e542f68
RBP: 00007f5b0e542f60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f5b0e542f6c
R13: 00007f5b0ea76b2f R14: 00007f5b0b9a5300 R15: 0000000000022000
----------------
Code disassembly (best guess):
0: 74 24 je 0x26
2: 10 e8 adc %ch,%al
4: 1a f6 sbb %dh,%dh
6: 20 f8 and %bh,%al
8: 48 89 ef mov %rbp,%rdi
b: e8 62 6c 21 f8 callq 0xf8216c72
10: 81 e3 00 02 00 00 and $0x200,%ebx
16: 75 25 jne 0x3d
18: 9c pushfq
19: 58 pop %rax
1a: f6 c4 02 test $0x2,%ah
1d: 75 2d jne 0x4c
1f: 48 85 db test %rbx,%rbx
22: 74 01 je 0x25
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 83 36 14 f8 callq 0xf81436b2 <-- trapping instruction
2f: 65 8b 05 fc 8d c6 76 mov %gs:0x76c68dfc(%rip),%eax # 0x76c68e32
36: 85 c0 test %eax,%eax
38: 74 0a je 0x44
3a: 5b pop %rbx
3b: 5d pop %rbp
3c: c3 retq
3d: e8 .byte 0xe8
3e: 80 .byte 0x80
3f: 1b .byte 0x1b