======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.6.418/6427 is trying to acquire lock:
ffff8880b9039b58 (&pool->lock){-.-.}-{2:2}, at: __queue_work+0x595/0xd50 kernel/workqueue.c:-1
but task is already holding lock:
ffffffff96606340 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq+0x6c/0x610 drivers/tty/serial/8250/8250_port.c:1895
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (&port_lock_key){-.-.}-{2:2}:
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xb0/0x100 kernel/locking/spinlock.c:162
serial8250_console_write+0x178/0x1000 drivers/tty/serial/8250/8250_port.c:3368
call_console_drivers kernel/printk/printk.c:-1 [inline]
console_unlock+0xb9a/0x1120 kernel/printk/printk.c:2744
vprintk_emit+0xc0/0x150 kernel/printk/printk.c:2274
_printk+0xda/0x130 kernel/printk/printk.c:2299
register_console+0x699/0x980 kernel/printk/printk.c:3107
univ8250_console_init+0x41/0x50 drivers/tty/serial/8250/8250_core.c:690
console_init+0x177/0x5d0 kernel/printk/printk.c:3207
start_kernel+0x2fc/0x540 init/main.c:1090
secondary_startup_64_no_verify+0xb1/0xbb
-> #1 (console_owner){-.-.}-{0:0}:
console_lock_spinning_enable+0x51/0x60 kernel/printk/printk.c:1805
console_unlock+0x8b6/0x1120 kernel/printk/printk.c:2741
vprintk_emit+0xc0/0x150 kernel/printk/printk.c:2274
_printk+0xda/0x130 kernel/printk/printk.c:2299
fail_dump lib/fault-inject.c:45 [inline]
should_fail+0x36d/0x4c0 lib/fault-inject.c:146
prepare_alloc_pages+0x1e4/0x5f0 mm/page_alloc.c:5277
__alloc_pages+0x11b/0x480 mm/page_alloc.c:5490
stack_depot_save+0x342/0x440 lib/stackdepot.c:302
kasan_save_stack+0x4b/0x60 mm/kasan/common.c:40
kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
insert_work+0x54/0x3d0 kernel/workqueue.c:1366
__queue_work+0x9c5/0xd50 kernel/workqueue.c:1532
queue_work_on+0x124/0x1f0 kernel/workqueue.c:1559
queue_work include/linux/workqueue.h:512 [inline]
schedule_work include/linux/workqueue.h:573 [inline]
__rhashtable_remove_fast_one include/linux/rhashtable.h:1059 [inline]
__rhashtable_remove_fast include/linux/rhashtable.h:1083 [inline]
rhashtable_remove_fast include/linux/rhashtable.h:1112 [inline]
ipc_kht_remove+0x9e3/0xa90 ipc/util.c:450
ipc_set_key_private+0x19/0x60 ipc/util.c:524
do_shm_rmid+0xa4/0x180 ipc/shm.c:132
shmctl_down+0x20e/0x270 ipc/shm.c:1016
ksys_shmctl ipc/shm.c:1283 [inline]
__do_sys_shmctl ipc/shm.c:1294 [inline]
__se_sys_shmctl+0x390/0x690 ipc/shm.c:1292
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
-> #0 (&pool->lock){-.-.}-{2:2}:
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
__queue_work+0x595/0xd50 kernel/workqueue.c:-1
queue_work_on+0x124/0x1f0 kernel/workqueue.c:1559
serial8250_modem_status+0x196/0x270 drivers/tty/serial/8250/8250_port.c:1855
serial8250_handle_irq+0x438/0x610 drivers/tty/serial/8250/8250_port.c:1921
serial8250_default_handle_irq+0xb4/0x1a0 drivers/tty/serial/8250/8250_port.c:1941
serial8250_interrupt+0x9b/0x1c0 drivers/tty/serial/8250/8250_core.c:127
__handle_irq_event_percpu+0x299/0x9d0 kernel/irq/handle.c:156
handle_irq_event_percpu kernel/irq/handle.c:196 [inline]
handle_irq_event+0xa5/0x220 kernel/irq/handle.c:213
handle_edge_irq+0x243/0xb20 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:233 [inline]
__common_interrupt+0xd7/0x1e0 arch/x86/kernel/irq.c:252
common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:242
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:667
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline]
_raw_spin_unlock_irqrestore+0xbc/0x120 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:419 [inline]
uart_update_mctrl drivers/tty/serial/serial_core.c:157 [inline]
uart_tiocmset+0x22e/0x2c0 drivers/tty/serial/serial_core.c:1094
tty_tiocmset drivers/tty/tty_io.c:2592 [inline]
tty_ioctl+0x9c8/0xc20 drivers/tty/tty_io.c:2785
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
other info that might help us debug this:
Chain exists of:
&pool->lock --> console_owner --> &port_lock_key
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&port_lock_key);
lock(console_owner);
lock(&port_lock_key);
lock(&pool->lock);
*** DEADLOCK ***
4 locks held by syz.6.418/6427:
#0: ffff8881475b0e90 (&port->mutex){+.+.}-{3:3}, at: uart_tiocmset+0x54/0x2c0 drivers/tty/serial/serial_core.c:1088
#1: ffff8880210e3530 (&i->lock){-.-.}-{2:2}, at: spin_lock include/linux/spinlock.h:364 [inline]
#1: ffff8880210e3530 (&i->lock){-.-.}-{2:2}, at: serial8250_interrupt+0x3e/0x1c0 drivers/tty/serial/8250/8250_core.c:117
#2: ffffffff96606340 (&port_lock_key){-.-.}-{2:2}, at: serial8250_handle_irq+0x6c/0x610 drivers/tty/serial/8250/8250_port.c:1895
#3: ffffffff8c31f360 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:312
stack backtrace:
CPU: 0 PID: 6427 Comm: syz.6.418 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
Call Trace:
<IRQ>
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
__queue_work+0x595/0xd50 kernel/workqueue.c:-1
queue_work_on+0x124/0x1f0 kernel/workqueue.c:1559
serial8250_modem_status+0x196/0x270 drivers/tty/serial/8250/8250_port.c:1855
serial8250_handle_irq+0x438/0x610 drivers/tty/serial/8250/8250_port.c:1921
serial8250_default_handle_irq+0xb4/0x1a0 drivers/tty/serial/8250/8250_port.c:1941
serial8250_interrupt+0x9b/0x1c0 drivers/tty/serial/8250/8250_core.c:127
__handle_irq_event_percpu+0x299/0x9d0 kernel/irq/handle.c:156
handle_irq_event_percpu kernel/irq/handle.c:196 [inline]
handle_irq_event+0xa5/0x220 kernel/irq/handle.c:213
handle_edge_irq+0x243/0xb20 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:233 [inline]
__common_interrupt+0xd7/0x1e0 arch/x86/kernel/irq.c:252
common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:242
</IRQ>
<TASK>
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:667
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0xbc/0x120 kernel/locking/spinlock.c:194
Code: c7 44 24 20 00 00 00 00 9c 8f 44 24 20 f7 44 24 20 00 02 00 00 41 c6 04 07 f8 75 4b f7 c3 00 02 00 00 74 01 fb bf 01 00 00 00 <e8> 4f 9d 8b f7 65 8b 05 70 86 3b 76 85 c0 74 3c 48 c7 04 24 0e 36
RSP: 0018:ffffc9000371fdc0 EFLAGS: 00000206
RAX: dffffc0000000004 RBX: 0000000000000a06 RCX: d35ed996d3fa8e00
RDX: dffffc0000000000 RSI: ffffffff8a2b3180 RDI: 0000000000000001
RBP: ffffc9000371fe50 R08: ffffffff901d8117 R09: 1ffffffff203b022
R10: dffffc0000000000 R11: fffffbfff203b023 R12: dffffc0000000000
R13: ffffffff96606478 R14: ffffffff96606328 R15: 1ffff920006e3fb8
spin_unlock_irqrestore include/linux/spinlock.h:419 [inline]
uart_update_mctrl drivers/tty/serial/serial_core.c:157 [inline]
uart_tiocmset+0x22e/0x2c0 drivers/tty/serial/serial_core.c:1094
tty_tiocmset drivers/tty/tty_io.c:2592 [inline]
tty_ioctl+0x9c8/0xc20 drivers/tty/tty_io.c:2785
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7eff6d754e59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007eff6b9ae028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007eff6d9cdfa0 RCX: 00007eff6d754e59
RDX: 0000200000000000 RSI: 0000000000005418 RDI: 0000000000000003
RBP: 00007eff6d7ead6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007eff6d9ce038 R14: 00007eff6d9cdfa0 R15: 00007fff70189df8
</TASK>
----------------
Code disassembly (best guess):
0: c7 44 24 20 00 00 00 movl $0x0,0x20(%rsp)
7: 00
8: 9c pushf
9: 8f 44 24 20 pop 0x20(%rsp)
d: f7 44 24 20 00 02 00 testl $0x200,0x20(%rsp)
14: 00
15: 41 c6 04 07 f8 movb $0xf8,(%r15,%rax,1)
1a: 75 4b jne 0x67
1c: f7 c3 00 02 00 00 test $0x200,%ebx
22: 74 01 je 0x25
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 4f 9d 8b f7 call 0xf78b9d7e <-- trapping instruction
2f: 65 8b 05 70 86 3b 76 mov %gs:0x763b8670(%rip),%eax # 0x763b86a6
36: 85 c0 test %eax,%eax
38: 74 3c je 0x76
3a: 48 rex.W
3b: c7 .byte 0xc7
3c: 04 24 add $0x24,%al
3e: 0e (bad)
3f: 36 ss