============================================
WARNING: possible recursive locking detected
5.16.0-rc3-syzkaller #0 Not tainted
--------------------------------------------
kworker/u4:10/9471 is trying to acquire lock:
ffffffff90799c10 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x12c/0x570 drivers/tty/serial/serial_core.c:577
but task is already holding lock:
ffffffff90799c10 (&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 kworker/u4:10/9471:
#0: ffff888025b85938 ((wq_completion)bat_events){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
#0: ffff888025b85938 ((wq_completion)bat_events){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
#0: ffff888025b85938 ((wq_completion)bat_events){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1198 [inline]
#0: ffff888025b85938 ((wq_completion)bat_events){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:635 [inline]
#0: ffff888025b85938 ((wq_completion)bat_events){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:662 [inline]
#0: ffff888025b85938 ((wq_completion)bat_events){+.+.}-{0:0}, at: process_one_work+0x896/0x1690 kernel/workqueue.c:2269
#1: ffffc90004167db0 ((work_completion)(&(&bat_priv->nc.work)->work)){+.+.}-{0:0}, at: process_one_work+0x8ca/0x1690 kernel/workqueue.c:2273
#2: ffff8880305936b0 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline]
#2: ffff8880305936b0 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x3a/0x200 drivers/tty/serial/8250/8250_core.c:116
#3: ffffffff90799c10 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1908
#4: ffff88801a7a6098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:273
stack backtrace:
CPU: 1 PID: 9471 Comm: kworker/u4:10 Not tainted 5.16.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: bat_events batadv_nc_worker
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:check_preemption_disabled+0x4/0x170 lib/smp_processor_id.c:13
Code: 00 00 e8 3f b5 56 f8 65 48 8b 3c 25 40 70 02 00 e8 e1 e1 0d f8 eb 99 0f 1f 44 00 00 0f 0b e9 23 ff ff ff cc cc cc 41 56 41 55 <49> 89 f5 41 54 55 48 89 fd 53 0f 1f 44 00 00 65 44 8b 25 cd d7 bd
RSP: 0018:ffffc90004167b60 EFLAGS: 00000282
RAX: 0000000000000001 RBX: 1ffff9200082cf76 RCX: ffffffff815bfa98
RDX: 0000000000000001 RSI: ffffffff8a049020 RDI: ffffffff8a049060
RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff8d90f197
R10: fffffbfff1b21e32 R11: 0000000000000000 R12: 0000000000000001
R13: 0000000000000000 R14: ffffffff8bb80fe0 R15: 0000000000000000
rcu_lockdep_current_cpu_online kernel/rcu/tree.c:1169 [inline]
rcu_lockdep_current_cpu_online+0x2d/0x150 kernel/rcu/tree.c:1160
rcu_read_lock_held_common kernel/rcu/update.c:112 [inline]
rcu_read_lock_held_common kernel/rcu/update.c:102 [inline]
rcu_read_lock_sched_held+0x25/0x70 kernel/rcu/update.c:123
trace_lock_acquire include/trace/events/lock.h:13 [inline]
lock_acquire+0x442/0x510 kernel/locking/lockdep.c:5608
rcu_lock_acquire include/linux/rcupdate.h:268 [inline]
rcu_read_lock include/linux/rcupdate.h:688 [inline]
batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:412 [inline]
batadv_nc_worker+0x12d/0xfa0 net/batman-adv/network-coding.c:723
process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298
worker_thread+0x658/0x11f0 kernel/workqueue.c:2445
kthread+0x405/0x4f0 kernel/kthread.c:327
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
----------------
Code disassembly (best guess):
0: 00 00 add %al,(%rax)
2: e8 3f b5 56 f8 callq 0xf856b546
7: 65 48 8b 3c 25 40 70 mov %gs:0x27040,%rdi
e: 02 00
10: e8 e1 e1 0d f8 callq 0xf80de1f6
15: eb 99 jmp 0xffffffb0
17: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
1c: 0f 0b ud2
1e: e9 23 ff ff ff jmpq 0xffffff46
23: cc int3
24: cc int3
25: cc int3
26: 41 56 push %r14
28: 41 55 push %r13
* 2a: 49 89 f5 mov %rsi,%r13 <-- trapping instruction
2d: 41 54 push %r12
2f: 55 push %rbp
30: 48 89 fd mov %rdi,%rbp
33: 53 push %rbx
34: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
39: 65 gs
3a: 44 rex.R
3b: 8b .byte 0x8b
3c: 25 .byte 0x25
3d: cd d7 int $0xd7
3f: bd .byte 0xbd