============================================
WARNING: possible recursive locking detected
5.15.0-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.5/7335 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.5/7335:
#0: ffff88802267c3b8 (&xt[i].compat_mutex){+.+.}-{3:3}, at: get_info+0x155/0x740 net/ipv6/netfilter/ip6_tables.c:979
#1: ffff88802267c308 (&xt[i].mutex){+.+.}-{3:3}, at: xt_find_table_lock+0x140/0x680 net/netfilter/x_tables.c:1242
#2: ffff8880630d1cb0 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline]
#2: ffff8880630d1cb0 (&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: ffff888020808098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:273
stack backtrace:
CPU: 1 PID: 7335 Comm: syz-executor.5 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:orc_ip arch/x86/kernel/unwind_orc.c:30 [inline]
RIP: 0010:__orc_find+0x6f/0xf0 arch/x86/kernel/unwind_orc.c:52
Code: 72 4d 4c 89 e0 48 29 e8 48 89 c2 48 c1 e8 3f 48 c1 fa 02 48 01 d0 48 d1 f8 48 8d 5c 85 00 48 89 d8 48 c1 e8 03 42 0f b6 14 38 <48> 89 d8 83 e0 07 83 c0 03 38 d0 7c 04 84 d2 75 48 48 63 03 48 01
RSP: 0018:ffffc90004ccf2c0 EFLAGS: 00000a06
RAX: 1ffffffff1ba2288 RBX: ffffffff8dd11440 RCX: ffffffff87c3c181
RDX: 0000000000000000 RSI: ffffffff8e696c6a RDI: ffffffff8dd11430
RBP: ffffffff8dd11430 R08: 0000000000000000 R09: ffffffff8e696c6a
R10: fffff52000999e87 R11: 0000000000086089 R12: ffffffff8dd11450
R13: ffffffff8dd11430 R14: ffffffff8dd11430 R15: dffffc0000000000
orc_find arch/x86/kernel/unwind_orc.c:173 [inline]
unwind_next_frame+0x32a/0x1ce0 arch/x86/kernel/unwind_orc.c:443
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+0x1c/0x30 mm/kasan/common.c:46
kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360
____kasan_slab_free mm/kasan/common.c:366 [inline]
____kasan_slab_free mm/kasan/common.c:328 [inline]
__kasan_slab_free+0xff/0x130 mm/kasan/common.c:374
kasan_slab_free include/linux/kasan.h:235 [inline]
slab_free_hook mm/slub.c:1700 [inline]
slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1726
slab_free mm/slub.c:3492 [inline]
kfree+0xf3/0x550 mm/slub.c:4552
kvfree+0x42/0x50 mm/util.c:620
__vunmap+0x922/0xb70 mm/vmalloc.c:2626
__vfree+0x3c/0xd0 mm/vmalloc.c:2669
vfree+0x5a/0x90 mm/vmalloc.c:2700
xt_compat_flush_offsets+0x8b/0x160 net/netfilter/x_tables.c:691
get_info+0x28c/0x740 net/ipv6/netfilter/ip6_tables.c:990
do_ipt_get_ctl+0x152/0x9d0 net/ipv4/netfilter/ip_tables.c:1654
nf_getsockopt+0x72/0xd0 net/netfilter/nf_sockopt.c:116
ip_getsockopt net/ipv4/ip_sockglue.c:1786 [inline]
ip_getsockopt+0x164/0x1c0 net/ipv4/ip_sockglue.c:1765
tcp_getsockopt+0x86/0xd0 net/ipv4/tcp.c:4232
__sys_getsockopt+0x21f/0x5f0 net/socket.c:2220
__do_compat_sys_socketcall+0x513/0x660 net/compat.c:495
do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline]
__do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178
do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203
entry_SYSENTER_compat_after_hwframe+0x4d/0x5c
RIP: 0023:0xf6e9f549
Code: 03 74 c0 01 10 05 03 74 b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00
RSP: 002b:00000000f7530660 EFLAGS: 00000282 ORIG_RAX: 0000000000000066
RAX: ffffffffffffffda RBX: 000000000000000f RCX: 00000000f7530678
RDX: 00000000f75306e8 RSI: 00000000f75306e8 RDI: 00000000f753073c
RBP: 00000000f6fd9968 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
----------------
Code disassembly (best guess):
0: 72 4d jb 0x4f
2: 4c 89 e0 mov %r12,%rax
5: 48 29 e8 sub %rbp,%rax
8: 48 89 c2 mov %rax,%rdx
b: 48 c1 e8 3f shr $0x3f,%rax
f: 48 c1 fa 02 sar $0x2,%rdx
13: 48 01 d0 add %rdx,%rax
16: 48 d1 f8 sar %rax
19: 48 8d 5c 85 00 lea 0x0(%rbp,%rax,4),%rbx
1e: 48 89 d8 mov %rbx,%rax
21: 48 c1 e8 03 shr $0x3,%rax
25: 42 0f b6 14 38 movzbl (%rax,%r15,1),%edx
* 2a: 48 89 d8 mov %rbx,%rax <-- trapping instruction
2d: 83 e0 07 and $0x7,%eax
30: 83 c0 03 add $0x3,%eax
33: 38 d0 cmp %dl,%al
35: 7c 04 jl 0x3b
37: 84 d2 test %dl,%dl
39: 75 48 jne 0x83
3b: 48 63 03 movslq (%rbx),%rax
3e: 48 rex.W
3f: 01 .byte 0x1