====================================================== WARNING: possible circular locking dependency detected 5.10.109 #1 Not tainted ------------------------------------------------------ syz-executor.5/15713 is trying to acquire lock: ffff888054d2ae58 (&sighand->siglock){....}-{2:2}, at: __lock_task_sighand+0xd3/0x2f0 kernel/signal.c:1391 but task is already holding lock: ffff88800dd62578 (&tty->read_wait){....}-{2:2}, at: __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:122 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&tty->read_wait){....}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x36/0x50 kernel/locking/spinlock.c:159 __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:122 pty_flush_buffer+0x124/0x160 drivers/tty/pty.c:235 tty_driver_flush_buffer+0x60/0x80 drivers/tty/tty_ioctl.c:95 isig+0x1da/0x430 drivers/tty/n_tty.c:1137 n_tty_receive_signal_char+0x1f/0x150 drivers/tty/n_tty.c:1238 n_tty_receive_char_special+0x1255/0x2aa0 drivers/tty/n_tty.c:1284 n_tty_receive_buf_fast drivers/tty/n_tty.c:1605 [inline] __receive_buf drivers/tty/n_tty.c:1639 [inline] n_tty_receive_buf_common+0x1e57/0x2b70 drivers/tty/n_tty.c:1737 tiocsti drivers/tty/tty_io.c:2277 [inline] tty_ioctl+0x51b/0x1830 drivers/tty/tty_io.c:2658 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x196/0x210 fs/ioctl.c:739 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #1 (&tty->ctrl_lock){....}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x36/0x50 kernel/locking/spinlock.c:159 __proc_set_tty+0x2c/0x610 drivers/tty/tty_jobctrl.c:98 proc_set_tty drivers/tty/tty_jobctrl.c:121 [inline] tiocsctty drivers/tty/tty_jobctrl.c:387 [inline] tty_jobctrl_ioctl+0x57e/0xe10 drivers/tty/tty_jobctrl.c:564 tty_ioctl+0x1361/0x1830 drivers/tty/tty_io.c:2737 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x196/0x210 fs/ioctl.c:739 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #0 (&sighand->siglock){....}-{2:2}: check_prev_add kernel/locking/lockdep.c:2986 [inline] check_prevs_add kernel/locking/lockdep.c:3111 [inline] validate_chain kernel/locking/lockdep.c:3726 [inline] __lock_acquire+0x29e3/0x5b00 kernel/locking/lockdep.c:4952 lock_acquire kernel/locking/lockdep.c:5562 [inline] lock_acquire+0x197/0x490 kernel/locking/lockdep.c:5527 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x36/0x50 kernel/locking/spinlock.c:159 __lock_task_sighand+0xd3/0x2f0 kernel/signal.c:1391 lock_task_sighand include/linux/sched/signal.h:693 [inline] task_work_add+0x1db/0x2b0 kernel/task_work.c:58 io_req_task_work_add fs/io_uring.c:2064 [inline] __io_async_wake+0x40b/0x8d0 fs/io_uring.c:4977 __wake_up_common+0x14c/0x4c0 kernel/sched/wait.c:93 __wake_up_common_lock+0xd0/0x130 kernel/sched/wait.c:123 tty_ldisc_lock+0x40/0xb0 drivers/tty/tty_ldisc.c:335 tty_set_ldisc+0x8e/0x670 drivers/tty/tty_ldisc.c:562 tiocsetd drivers/tty/tty_io.c:2420 [inline] tty_ioctl+0x6cc/0x1830 drivers/tty/tty_io.c:2679 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x196/0x210 fs/ioctl.c:739 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 other info that might help us debug this: Chain exists of: &sighand->siglock --> &tty->ctrl_lock --> &tty->read_wait Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&tty->read_wait); lock(&tty->ctrl_lock); lock(&tty->read_wait); lock(&sighand->siglock); *** DEADLOCK *** 3 locks held by syz-executor.5/15713: #0: ffff88800dd621c0 (&tty->legacy_mutex){+.+.}-{3:3}, at: tty_lock+0xbd/0x120 drivers/tty/tty_mutex.c:19 #1: ffff88800dd62578 (&tty->read_wait){....}-{2:2}, at: __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:122 #2: ffffffff84df6fe0 (rcu_read_lock){....}-{1:2}, at: __lock_task_sighand+0x0/0x2f0 kernel/signal.c:1353 stack backtrace: CPU: 0 PID: 15713 Comm: syz-executor.5 Not tainted 5.10.109 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:118 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2121 check_prev_add kernel/locking/lockdep.c:2986 [inline] check_prevs_add kernel/locking/lockdep.c:3111 [inline] validate_chain kernel/locking/lockdep.c:3726 [inline] __lock_acquire+0x29e3/0x5b00 kernel/locking/lockdep.c:4952 lock_acquire kernel/locking/lockdep.c:5562 [inline] lock_acquire+0x197/0x490 kernel/locking/lockdep.c:5527 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x36/0x50 kernel/locking/spinlock.c:159 __lock_task_sighand+0xd3/0x2f0 kernel/signal.c:1391 lock_task_sighand include/linux/sched/signal.h:693 [inline] task_work_add+0x1db/0x2b0 kernel/task_work.c:58 io_req_task_work_add fs/io_uring.c:2064 [inline] __io_async_wake+0x40b/0x8d0 fs/io_uring.c:4977 __wake_up_common+0x14c/0x4c0 kernel/sched/wait.c:93 __wake_up_common_lock+0xd0/0x130 kernel/sched/wait.c:123 tty_ldisc_lock+0x40/0xb0 drivers/tty/tty_ldisc.c:335 tty_set_ldisc+0x8e/0x670 drivers/tty/tty_ldisc.c:562 tiocsetd drivers/tty/tty_io.c:2420 [inline] tty_ioctl+0x6cc/0x1830 drivers/tty/tty_io.c:2679 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x196/0x210 fs/ioctl.c:739 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f1fb3865b19 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:00007f1fb0ddb188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f1fb3978f60 RCX: 00007f1fb3865b19 RDX: 0000000020000080 RSI: 0000000000005423 RDI: 0000000000000004 RBP: 00007f1fb38bff6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc0f0bdc8f R14: 00007f1fb0ddb300 R15: 0000000000022000 hpet: Lost 8 RTC interrupts FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 9pnet: Could not find request transport: 7 ùöfdno=0x0000000000000003 CPU: 1 PID: 15725 Comm: syz-executor.7 Not tainted 5.10.109 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:118 fail_dump lib/fault-inject.c:52 [inline] should_fail.cold+0x5/0xa lib/fault-inject.c:146 should_failslab+0x5/0x10 mm/slab_common.c:1193 slab_pre_alloc_hook mm/slab.h:515 [inline] slab_alloc_node mm/slub.c:2821 [inline] slab_alloc mm/slub.c:2904 [inline] kmem_cache_alloc+0x5b/0x350 mm/slub.c:2909 kmem_cache_zalloc include/linux/slab.h:654 [inline] __alloc_file+0x21/0x310 fs/file_table.c:101 alloc_empty_file+0x6d/0x170 fs/file_table.c:151 path_openat+0xde/0x26c0 fs/namei.c:3346 do_filp_open+0x17e/0x3c0 fs/namei.c:3387 do_sys_openat2+0x16d/0x420 fs/open.c:1180 do_sys_open fs/open.c:1196 [inline] __do_sys_openat fs/open.c:1212 [inline] __se_sys_openat fs/open.c:1207 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1207 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fa893cc2a04 Code: 84 00 00 00 00 00 44 89 54 24 0c e8 96 f9 ff ff 44 8b 54 24 0c 44 89 e2 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 34 44 89 c7 89 44 24 0c e8 c8 f9 ff ff 8b 44 RSP: 002b:00007fa891284ed0 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fa893d59970 RCX: 00007fa893cc2a04 RDX: 0000000000000002 RSI: 00007fa891285000 RDI: 00000000ffffff9c RBP: 00007fa891285000 R08: 0000000000000000 R09: ffffffffffffffff R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000002 R13: 0000000000000005 R14: 0000000020000248 R15: 0000000000000003 audit: type=1326 audit(1654066132.171:121): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=15708 comm="syz-executor.5" exe="/syz-executor.5" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f1fb3865b19 code=0x0