============================================
WARNING: possible recursive locking detected
4.19.211-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.3/1498 is trying to acquire lock:
0000000044e54d4d (&port_lock_key){-.-.}, at: uart_write+0x1ce/0x6f0 drivers/tty/serial/serial_core.c:591
but task is already holding lock:
0000000044e54d4d (&port_lock_key){-.-.}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1876
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.3/1498:
#0: 0000000089a16b06 (sk_lock-AF_INET){+.+.}, at: lock_sock include/net/sock.h:1512 [inline]
#0: 0000000089a16b06 (sk_lock-AF_INET){+.+.}, at: sock_setsockopt+0x138/0x2060 net/core/sock.c:678
#1: 00000000206a5f3c (vmap_purge_lock){+.+.}, at: vm_unmap_aliases mm/vmalloc.c:1111 [inline]
#1: 00000000206a5f3c (vmap_purge_lock){+.+.}, at: vm_unmap_aliases+0x3a7/0x510 mm/vmalloc.c:1076
#2: 00000000868af1b1 ((&ndev->rs_timer)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:168 [inline]
#2: 00000000868af1b1 ((&ndev->rs_timer)){+.-.}, at: call_timer_fn+0xc9/0x700 kernel/time/timer.c:1328
#3: 0000000017875368 (&(&i->lock)->rlock){-.-.}, at: spin_lock include/linux/spinlock.h:329 [inline]
#3: 0000000017875368 (&(&i->lock)->rlock){-.-.}, at: serial8250_interrupt+0x3a/0x240 drivers/tty/serial/8250/8250_core.c:115
#4: 0000000044e54d4d (&port_lock_key){-.-.}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1876
#5: 000000000cec57a4 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:293
stack backtrace:
CPU: 1 PID: 1498 Comm: syz-executor.3 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
print_deadlock_bug kernel/locking/lockdep.c:1764 [inline]
check_deadlock kernel/locking/lockdep.c:1808 [inline]
validate_chain kernel/locking/lockdep.c:2404 [inline]
__lock_acquire.cold+0x121/0x57e kernel/locking/lockdep.c:3416
lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x8c/0xc0 kernel/locking/spinlock.c:152
uart_write+0x1ce/0x6f0 drivers/tty/serial/serial_core.c:591
n_hdlc_send_frames+0x278/0x470 drivers/tty/n_hdlc.c:403
n_hdlc_tty_wakeup+0xa0/0xc0 drivers/tty/n_hdlc.c:479
tty_wakeup+0xd4/0x110 drivers/tty/tty_io.c:534
tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:50
serial8250_tx_chars+0x490/0xaf0 drivers/tty/serial/8250/8250_port.c:1813
serial8250_handle_irq.part.0+0x31f/0x3d0 drivers/tty/serial/8250/8250_port.c:1900
serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1873 [inline]
serial8250_default_handle_irq+0xae/0x220 drivers/tty/serial/8250/8250_port.c:1916
serial8250_interrupt+0x101/0x240 drivers/tty/serial/8250/8250_core.c:125
__handle_irq_event_percpu+0x27e/0x8e0 kernel/irq/handle.c:149
handle_irq_event_percpu kernel/irq/handle.c:189 [inline]
handle_irq_event+0x102/0x290 kernel/irq/handle.c:206
handle_edge_irq+0x260/0xcf0 kernel/irq/chip.c:800
generic_handle_irq_desc include/linux/irqdesc.h:155 [inline]
handle_irq+0x35/0x50 arch/x86/kernel/irq_64.c:87
do_IRQ+0x93/0x1c0 arch/x86/kernel/irq.c:246
common_interrupt+0xf/0xf arch/x86/entry/entry_64.S:670
RIP: 0010:__kernel_text_address+0x23/0x30 kernel/extable.c:120
Code: 84 00 00 00 00 00 90 53 48 89 fb e8 07 ff ff ff 85 c0 75 17 48 81 fb 00 80 37 8c 72 0c 31 c0 48 81 fb 06 71 50 8c 0f 92 c0 5b b8 01 00 00 00 5b c3 0f 1f 44 00 00 48 81 ff 00 00 00 81 55 48
RSP: 0018:ffff8880ba107850 EFLAGS: 00000207 ORIG_RAX: ffffffffffffffd5
RAX: 0000000000000000 RBX: ffff8880ba107880 RCX: 1ffff110140615c8
RDX: dffffc0000000000 RSI: 0000000000000004 RDI: 0000000000000286
RBP: ffff8880ba1078c8 R08: 0000000000000000 R09: 0000000000000003
R10: 0000000000000000 R11: 0000000000074071 R12: ffff8880ba107918
R13: 0000000000000000 R14: ffff88823b33a540 R15: 00000000000000e8
unwind_get_return_address arch/x86/kernel/unwind_orc.c:297 [inline]
unwind_get_return_address+0x51/0x90 arch/x86/kernel/unwind_orc.c:292
__save_stack_trace+0xaf/0x190 arch/x86/kernel/stacktrace.c:45
save_stack mm/kasan/kasan.c:448 [inline]
set_track mm/kasan/kasan.c:460 [inline]
kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:553
kmem_cache_alloc_node+0x146/0x3b0 mm/slab.c:3649
__alloc_skb+0x71/0x560 net/core/skbuff.c:193
alloc_skb include/linux/skbuff.h:995 [inline]
ndisc_alloc_skb+0x134/0x320 net/ipv6/ndisc.c:403
ndisc_send_rs+0x33a/0x690 net/ipv6/ndisc.c:669
addrconf_rs_timer+0x384/0x6a0 net/ipv6/addrconf.c:3835
call_timer_fn+0x177/0x700 kernel/time/timer.c:1338
expire_timers+0x243/0x4e0 kernel/time/timer.c:1375
__run_timers kernel/time/timer.c:1696 [inline]
run_timer_softirq+0x21c/0x670 kernel/time/timer.c:1709
__do_softirq+0x265/0x980 kernel/softirq.c:292
invoke_softirq kernel/softirq.c:372 [inline]
irq_exit+0x215/0x260 kernel/softirq.c:412
exiting_irq arch/x86/include/asm/apic.h:536 [inline]
smp_apic_timer_interrupt+0x136/0x550 arch/x86/kernel/apic/apic.c:1098
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:169 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x50/0x80 kernel/locking/spinlock.c:192
Code: c0 98 82 f1 89 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 75 31 48 83 3d 01 31 d8 01 00 74 25 fb 66 0f 1f 44 00 00 01 00 00 00 e8 26 1b 28 f9 65 8b 05 9f 8d e8 77 85 c0 74 02 5d
RSP: 0018:ffff88804f2b7788 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13
RAX: 1ffffffff13e3053 RBX: ffff88804f2b77f8 RCX: 1ffff110140615c2
RDX: dffffc0000000000 RSI: ffff8880a030adf0 RDI: ffff8880a030adc4
RBP: ffff8880ba12b0c0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff8880a030a540
R13: ffff8880a030a540 R14: ffff88804f2b0000 R15: ffff8880ba12b0c0
rq_unlock_irq kernel/sched/sched.h:1851 [inline]
__schedule+0x15a9/0x2040 kernel/sched/core.c:3520
preempt_schedule_common+0x45/0xc0 kernel/sched/core.c:3641
__cond_resched_lock+0xe8/0xf0 kernel/sched/core.c:5031
__purge_vmap_area_lazy+0x1ba/0x280 mm/vmalloc.c:689
vm_unmap_aliases mm/vmalloc.c:1113 [inline]
vm_unmap_aliases+0x415/0x510 mm/vmalloc.c:1076
change_page_attr_set_clr+0x247/0xc60 arch/x86/mm/pageattr.c:1497
change_page_attr_clear arch/x86/mm/pageattr.c:1560 [inline]
set_memory_ro+0x78/0xa0 arch/x86/mm/pageattr.c:1789
bpf_prog_lock_ro include/linux/filter.h:714 [inline]
bpf_prog_select_runtime+0xb2/0x620 kernel/bpf/core.c:1587
bpf_migrate_filter+0x2dc/0x380 net/core/filter.c:1273
bpf_prepare_filter+0x183/0x370 net/core/filter.c:1321
__get_filter+0x1d4/0x270 net/core/filter.c:1490
sk_attach_filter+0x1c/0x170 net/core/filter.c:1505
sock_setsockopt+0x138d/0x2060 net/core/sock.c:893
__sys_setsockopt+0x203/0x240 net/socket.c:2009
__do_sys_setsockopt net/socket.c:2024 [inline]
__se_sys_setsockopt net/socket.c:2021 [inline]
__x64_sys_setsockopt+0xba/0x150 net/socket.c:2021
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f566ad8e3c9
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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f5669703168 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00007f566aea0f80 RCX: 00007f566ad8e3c9
RDX: 000000000000001a RSI: 0000000000000001 RDI: 0000000000000004
RBP: 00007f566ade933f R08: 0000000000000010 R09: 0000000000000000
R10: 0000000020000480 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd982d172f R14: 00007f5669703300 R15: 0000000000022000
----------------
Code disassembly (best guess):
0: 84 00 test %al,(%rax)
2: 00 00 add %al,(%rax)
4: 00 00 add %al,(%rax)
6: 90 nop
7: 53 push %rbx
8: 48 89 fb mov %rdi,%rbx
b: e8 07 ff ff ff callq 0xffffff17
10: 85 c0 test %eax,%eax
12: 75 17 jne 0x2b
14: 48 81 fb 00 80 37 8c cmp $0xffffffff8c378000,%rbx
1b: 72 0c jb 0x29
1d: 31 c0 xor %eax,%eax
1f: 48 81 fb 06 71 50 8c cmp $0xffffffff8c507106,%rbx
26: 0f 92 c0 setb %al
29: 5b pop %rbx
* 2a: c3 retq <-- trapping instruction
2b: b8 01 00 00 00 mov $0x1,%eax
30: 5b pop %rbx
31: c3 retq
32: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
37: 48 81 ff 00 00 00 81 cmp $0xffffffff81000000,%rdi
3e: 55 push %rbp
3f: 48 rex.W