============================================
WARNING: possible recursive locking detected
5.15.0-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.0/2194 is trying to acquire lock:
ffffffff90553eb0 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x12c/0x570 drivers/tty/serial/serial_core.c:570
but task is already holding lock:
ffffffff90553eb0 (&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.0/2194:
#0: ffffffff8d0de110 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x2f5/0x760 net/core/net_namespace.c:466
#1: ffffffff8d0f1828 (rtnl_mutex){+.+.}-{3:3}, at: register_netdev+0x11/0x50 net/core/dev.c:10452
#2: ffff8880726549b0 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline]
#2: ffff8880726549b0 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x3a/0x200 drivers/tty/serial/8250/8250_core.c:116
#3: ffffffff90553eb0 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq.part.0+0x21/0x3d0 drivers/tty/serial/8250/8250_port.c:1908
#4: ffff88806bfb4098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref+0x1d/0x80 drivers/tty/tty_ldisc.c:273
stack backtrace:
CPU: 0 PID: 2194 Comm: syz-executor.0 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:unwind_next_frame+0xdad/0x1ce0 arch/x86/kernel/unwind_orc.c:593
Code: c1 ea 03 48 c1 ee 03 0f b6 14 02 0f b6 04 06 4c 89 fe 83 e6 07 40 38 f2 40 0f 9e c6 84 d2 0f 95 c2 40 84 d6 0f 85 87 0d 00 00 <83> e1 07 38 c8 0f 9e c2 84 c0 0f 95 c0 84 c2 0f 85 72 0d 00 00 41
RSP: 0018:ffffc9000c4bf228 EFLAGS: 00000246
RAX: 0000000000000000 RBX: 1ffff92001897e4d RCX: ffffffff8df5b0b5
RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffffc9000c4bf358
RBP: 0000000000000001 R08: ffffffff8df5b0b0 R09: 0000000000000001
R10: fffff52001897e6b R11: 0000000000086089 R12: ffffc9000c4bf638
R13: ffffc9000c4bf335 R14: ffffc9000c4bf300 R15: ffffffff8df5b0b4
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 mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
__kasan_slab_alloc+0x83/0xb0 mm/kasan/common.c:467
kasan_slab_alloc include/linux/kasan.h:259 [inline]
slab_post_alloc_hook mm/slab.h:519 [inline]
slab_alloc_node mm/slub.c:3213 [inline]
slab_alloc mm/slub.c:3221 [inline]
kmem_cache_alloc+0x209/0x390 mm/slub.c:3226
kmem_cache_zalloc include/linux/slab.h:711 [inline]
__kernfs_new_node+0xd4/0x8b0 fs/kernfs/dir.c:585
kernfs_new_node+0x93/0x120 fs/kernfs/dir.c:647
__kernfs_create_file+0x51/0x350 fs/kernfs/file.c:985
sysfs_add_file_mode_ns+0x226/0x540 fs/sysfs/file.c:317
create_files fs/sysfs/group.c:64 [inline]
internal_create_group+0x328/0xb20 fs/sysfs/group.c:149
internal_create_groups.part.0+0x90/0x140 fs/sysfs/group.c:189
internal_create_groups fs/sysfs/group.c:185 [inline]
sysfs_create_groups+0x25/0x50 fs/sysfs/group.c:215
device_add_groups drivers/base/core.c:2475 [inline]
device_add_attrs drivers/base/core.c:2623 [inline]
device_add+0x81f/0x1ee0 drivers/base/core.c:3347
netdev_register_kobject+0x181/0x430 net/core/net-sysfs.c:2010
register_netdevice+0xd31/0x1500 net/core/dev.c:10330
register_netdev+0x2d/0x50 net/core/dev.c:10454
sit_init_net+0x350/0xaa0 net/ipv6/sit.c:1923
ops_init+0xaf/0x470 net/core/net_namespace.c:140
setup_net+0x40f/0xa30 net/core/net_namespace.c:326
copy_net_ns+0x319/0x760 net/core/net_namespace.c:470
create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226
ksys_unshare+0x445/0x920 kernel/fork.c:3074
__do_sys_unshare kernel/fork.c:3148 [inline]
__se_sys_unshare kernel/fork.c:3146 [inline]
__x64_sys_unshare+0x2d/0x40 kernel/fork.c:3146
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:0x7fe5b9c0fae9
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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fe5b7185188 EFLAGS: 00000246 ORIG_RAX: 0000000000000110
RAX: ffffffffffffffda RBX: 00007fe5b9d22f60 RCX: 00007fe5b9c0fae9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000040000000
RBP: 00007fe5b9c69f25 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffea91db7ef R14: 00007fe5b7185300 R15: 0000000000022000
----------------
Code disassembly (best guess):
0: c1 ea 03 shr $0x3,%edx
3: 48 c1 ee 03 shr $0x3,%rsi
7: 0f b6 14 02 movzbl (%rdx,%rax,1),%edx
b: 0f b6 04 06 movzbl (%rsi,%rax,1),%eax
f: 4c 89 fe mov %r15,%rsi
12: 83 e6 07 and $0x7,%esi
15: 40 38 f2 cmp %sil,%dl
18: 40 0f 9e c6 setle %sil
1c: 84 d2 test %dl,%dl
1e: 0f 95 c2 setne %dl
21: 40 84 d6 test %dl,%sil
24: 0f 85 87 0d 00 00 jne 0xdb1
* 2a: 83 e1 07 and $0x7,%ecx <-- trapping instruction
2d: 38 c8 cmp %cl,%al
2f: 0f 9e c2 setle %dl
32: 84 c0 test %al,%al
34: 0f 95 c0 setne %al
37: 84 c2 test %al,%dl
39: 0f 85 72 0d 00 00 jne 0xdb1
3f: 41 rex.B