sp0: Synchronizing with TNC
------------[ cut here ]------------
======================================================
WARNING: possible circular locking dependency detected
6.9.0-syzkaller-11919-g5f16eb0549ab #0 Not tainted
------------------------------------------------------
syz-executor.3/5720 is trying to acquire lock:
ffffffff8dac2620 (console_owner){....}-{0:0}, at: console_trylock_spinning kernel/printk/printk.c:1994 [inline]
ffffffff8dac2620 (console_owner){....}-{0:0}, at: vprintk_emit kernel/printk/printk.c:2344 [inline]
ffffffff8dac2620 (console_owner){....}-{0:0}, at: vprintk_emit+0x42d/0x5a0 kernel/printk/printk.c:2300
but task is already holding lock:
ffffffff94d66b98 (&port_lock_key){-.-.}-{2:2}, at: uart_port_lock_irqsave include/linux/serial_core.h:618 [inline]
ffffffff94d66b98 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x134/0x3e0 drivers/tty/serial/serial_core.c:624
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&port_lock_key){-.-.}-{2:2}:
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
uart_port_lock_irqsave include/linux/serial_core.h:618 [inline]
serial8250_console_write+0xaa6/0x1090 drivers/tty/serial/8250/8250_port.c:3352
console_emit_next_record kernel/printk/printk.c:2928 [inline]
console_flush_all+0x53f/0xd70 kernel/printk/printk.c:2994
console_unlock+0xae/0x290 kernel/printk/printk.c:3063
vprintk_emit kernel/printk/printk.c:2345 [inline]
vprintk_emit+0x11a/0x5a0 kernel/printk/printk.c:2300
vprintk+0x7f/0xa0 kernel/printk/printk_safe.c:45
_printk+0xc8/0x100 kernel/printk/printk.c:2370
register_console+0xa88/0x10a0 kernel/printk/printk.c:3596
univ8250_console_init+0x35/0x50 drivers/tty/serial/8250/8250_core.c:719
console_init+0xcc/0x680 kernel/printk/printk.c:3742
start_kernel+0x295/0x4c0 init/main.c:1038
x86_64_start_reservations+0x18/0x30 arch/x86/kernel/head64.c:507
x86_64_start_kernel+0xb2/0xc0 arch/x86/kernel/head64.c:488
common_startup_64+0x13e/0x148
-> #0 (console_owner){....}-{0:0}:
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137
lock_acquire kernel/locking/lockdep.c:5754 [inline]
lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719
console_trylock_spinning kernel/printk/printk.c:1994 [inline]
vprintk_emit kernel/printk/printk.c:2344 [inline]
vprintk_emit+0x442/0x5a0 kernel/printk/printk.c:2300
vprintk+0x7f/0xa0 kernel/printk/printk_safe.c:45
_printk+0xc8/0x100 kernel/printk/printk.c:2370
__report_bug lib/bug.c:195 [inline]
report_bug+0x4ac/0x580 lib/bug.c:219
handle_bug+0x3d/0x70 arch/x86/kernel/traps.c:239
exc_invalid_op+0x17/0x50 arch/x86/kernel/traps.c:260
asm_exc_invalid_op+0x1a/0x20 arch/x86/include/asm/idtentry.h:621
uart_write+0x2bf/0x3e0 drivers/tty/serial/serial_core.c:625
tnc_init drivers/net/hamradio/6pack.c:531 [inline]
sixpack_open+0x93b/0xb30 drivers/net/hamradio/6pack.c:628
tty_ldisc_open+0x9c/0x120 drivers/tty/tty_ldisc.c:432
tty_set_ldisc+0x318/0x720 drivers/tty/tty_ldisc.c:563
tiocsetd drivers/tty/tty_io.c:2439 [inline]
tty_ioctl+0xc2e/0x1650 drivers/tty/tty_io.c:2739
tty_compat_ioctl+0x25c/0x4f0 drivers/tty/tty_io.c:2953
__do_compat_sys_ioctl+0x2c3/0x330 fs/ioctl.c:1007
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386
do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411
entry_SYSENTER_compat_after_hwframe+0x84/0x8e
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&port_lock_key);
lock(console_owner);
lock(&port_lock_key);
lock(console_owner);
*** DEADLOCK ***
3 locks held by syz-executor.3/5720:
#0: ffff88802aeb31c0 (&tty->legacy_mutex){+.+.}-{3:3}, at: tty_set_ldisc+0x8b/0x720 drivers/tty/tty_ldisc.c:528
#1: ffff88802aeb30a0 (&tty->ldisc_sem){++++}-{0:0}, at: __tty_ldisc_lock drivers/tty/tty_ldisc.c:289 [inline]
#1: ffff88802aeb30a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_lock+0x65/0xb0 drivers/tty/tty_ldisc.c:313
#2: ffffffff94d66b98 (&port_lock_key){-.-.}-{2:2}, at: uart_port_lock_irqsave include/linux/serial_core.h:618 [inline]
#2: ffffffff94d66b98 (&port_lock_key){-.-.}-{2:2}, at: uart_write+0x134/0x3e0 drivers/tty/serial/serial_core.c:624
stack backtrace:
CPU: 0 PID: 5720 Comm: syz-executor.3 Not tainted 6.9.0-syzkaller-11919-g5f16eb0549ab #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114
check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2187
check_prev_add kernel/locking/lockdep.c:3134 [inline]
check_prevs_add kernel/locking/lockdep.c:3253 [inline]
validate_chain kernel/locking/lockdep.c:3869 [inline]
__lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137
lock_acquire kernel/locking/lockdep.c:5754 [inline]
lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719
console_trylock_spinning kernel/printk/printk.c:1994 [inline]
vprintk_emit kernel/printk/printk.c:2344 [inline]
vprintk_emit+0x442/0x5a0 kernel/printk/printk.c:2300
vprintk+0x7f/0xa0 kernel/printk/printk_safe.c:45
_printk+0xc8/0x100 kernel/printk/printk.c:2370
__report_bug lib/bug.c:195 [inline]
report_bug+0x4ac/0x580 lib/bug.c:219
handle_bug+0x3d/0x70 arch/x86/kernel/traps.c:239
exc_invalid_op+0x17/0x50 arch/x86/kernel/traps.c:260
asm_exc_invalid_op+0x1a/0x20 arch/x86/include/asm/idtentry.h:621
RIP: 0010:uart_write+0x2bf/0x3e0 drivers/tty/serial/serial_core.c:625
Code: 6f fc e9 4e ff ff ff e8 9f 52 95 fc 90 0f 0b 90 49 c7 c4 d2 ff ff ff e9 39 ff ff ff e8 8a 52 95 fc 45 31 ff e8 82 52 95 fc 90 <0f> 0b 90 48 85 ed 74 8c e8 74 52 95 fc 4c 8d a5 08 01 00 00 4c 89
RSP: 0018:ffffc90006f1fb88 EFLAGS: 00010046
RAX: 0000000000040000 RBX: ffff88801e088be8 RCX: ffffc9000c202000
RDX: 0000000000040000 RSI: ffffffff84f932fe RDI: ffff88801e088f48
RBP: ffffffff94d66b80 R08: 0000000000000001 R09: fffff52000de3f5f
R10: 0000000000000003 R11: 0000000000000003 R12: 0000000000000001
R13: 0000000000000001 R14: ffff88805896cf01 R15: 0000000000000246
tnc_init drivers/net/hamradio/6pack.c:531 [inline]
sixpack_open+0x93b/0xb30 drivers/net/hamradio/6pack.c:628
tty_ldisc_open+0x9c/0x120 drivers/tty/tty_ldisc.c:432
tty_set_ldisc+0x318/0x720 drivers/tty/tty_ldisc.c:563
tiocsetd drivers/tty/tty_io.c:2439 [inline]
tty_ioctl+0xc2e/0x1650 drivers/tty/tty_io.c:2739
tty_compat_ioctl+0x25c/0x4f0 drivers/tty/tty_io.c:2953
__do_compat_sys_ioctl+0x2c3/0x330 fs/ioctl.c:1007
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386
do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411
entry_SYSENTER_compat_after_hwframe+0x84/0x8e
RIP: 0023:0xf72a8579
Code: 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 00 00 00 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:00000000f5e795ac EFLAGS: 00000292 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000005423
RDX: 0000000020000c00 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
WARNING: CPU: 0 PID: 5720 at drivers/tty/serial/serial_core.c:625 uart_write+0x2bf/0x3e0 drivers/tty/serial/serial_core.c:625
Modules linked in:
CPU: 0 PID: 5720 Comm: syz-executor.3 Not tainted 6.9.0-syzkaller-11919-g5f16eb0549ab #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
RIP: 0010:uart_write+0x2bf/0x3e0 drivers/tty/serial/serial_core.c:625
Code: 6f fc e9 4e ff ff ff e8 9f 52 95 fc 90 0f 0b 90 49 c7 c4 d2 ff ff ff e9 39 ff ff ff e8 8a 52 95 fc 45 31 ff e8 82 52 95 fc 90 <0f> 0b 90 48 85 ed 74 8c e8 74 52 95 fc 4c 8d a5 08 01 00 00 4c 89
RSP: 0018:ffffc90006f1fb88 EFLAGS: 00010046
RAX: 0000000000040000 RBX: ffff88801e088be8 RCX: ffffc9000c202000
RDX: 0000000000040000 RSI: ffffffff84f932fe RDI: ffff88801e088f48
RBP: ffffffff94d66b80 R08: 0000000000000001 R09: fffff52000de3f5f
R10: 0000000000000003 R11: 0000000000000003 R12: 0000000000000001
R13: 0000000000000001 R14: ffff88805896cf01 R15: 0000000000000246
FS: 0000000000000000(0000) GS:ffff88802c000000(0063) knlGS:00000000f5e79b40
CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000f73d4894 CR3: 000000005b2d6000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
tnc_init drivers/net/hamradio/6pack.c:531 [inline]
sixpack_open+0x93b/0xb30 drivers/net/hamradio/6pack.c:628
tty_ldisc_open+0x9c/0x120 drivers/tty/tty_ldisc.c:432
tty_set_ldisc+0x318/0x720 drivers/tty/tty_ldisc.c:563
tiocsetd drivers/tty/tty_io.c:2439 [inline]
tty_ioctl+0xc2e/0x1650 drivers/tty/tty_io.c:2739
tty_compat_ioctl+0x25c/0x4f0 drivers/tty/tty_io.c:2953
__do_compat_sys_ioctl+0x2c3/0x330 fs/ioctl.c:1007
do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
__do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386
do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411
entry_SYSENTER_compat_after_hwframe+0x84/0x8e
RIP: 0023:0xf72a8579
Code: 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 00 00 00 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:00000000f5e795ac EFLAGS: 00000292 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000005423
RDX: 0000000020000c00 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
----------------
Code disassembly (best guess), 2 bytes skipped:
0: 10 06 adc %al,(%rsi)
2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi
6: 10 07 adc %al,(%rdi)
8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi
c: 10 08 adc %cl,(%rax)
e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi
1e: 00 51 52 add %dl,0x52(%rcx)
21: 55 push %rbp
22: 89 e5 mov %esp,%ebp
24: 0f 34 sysenter
26: cd 80 int $0x80
* 28: 5d pop %rbp <-- trapping instruction
29: 5a pop %rdx
2a: 59 pop %rcx
2b: c3 ret
2c: 90 nop
2d: 90 nop
2e: 90 nop
2f: 90 nop
30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi
37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi