====================================================== WARNING: possible circular locking dependency detected 5.10.155 #1 Not tainted ------------------------------------------------------ syz-executor.3/235203 is trying to acquire lock: ffff88804ac1f578 (&tty->read_wait){....}-{2:2}, at: __wake_up_common_lock+0xb4/0x140 kernel/sched/wait.c:122 but task is already holding lock: ffff88804ac1d3b8 (&tty->ctrl_lock){....}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:379 [inline] ffff88804ac1d3b8 (&tty->ctrl_lock){....}-{2:2}, at: pty_flush_buffer+0xaf/0x160 drivers/tty/pty.c:223 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&tty->ctrl_lock){....}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x36/0x60 kernel/locking/spinlock.c:159 __proc_set_tty+0x2c/0x620 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+0x582/0xe20 drivers/tty/tty_jobctrl.c:564 tty_ioctl+0x1365/0x1840 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+0x19a/0x210 fs/ioctl.c:739 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xc6 -> #1 (&sighand->siglock){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x36/0x60 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+0x1df/0x2b0 kernel/task_work.c:58 io_req_task_work_add fs/io_uring.c:2069 [inline] __io_async_wake+0x40b/0x8d0 fs/io_uring.c:4949 __wake_up_common+0x14c/0x4c0 kernel/sched/wait.c:93 __wake_up_common_lock+0xd0/0x140 kernel/sched/wait.c:123 tty_ldisc_lock+0x40/0xb0 drivers/tty/tty_ldisc.c:335 tty_ldisc_hangup+0x204/0x690 drivers/tty/tty_ldisc.c:744 __tty_hangup.part.0+0x510/0x9b0 drivers/tty/tty_io.c:624 __tty_hangup drivers/tty/tty_io.c:574 [inline] tty_vhangup drivers/tty/tty_io.c:697 [inline] tty_ioctl+0x1212/0x1840 drivers/tty/tty_io.c:2683 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+0x19a/0x210 fs/ioctl.c:739 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xc6 -> #0 (&tty->read_wait){....}-{2:2}: check_prev_add kernel/locking/lockdep.c:2988 [inline] check_prevs_add kernel/locking/lockdep.c:3113 [inline] validate_chain kernel/locking/lockdep.c:3728 [inline] __lock_acquire+0x29e7/0x5b00 kernel/locking/lockdep.c:4954 lock_acquire kernel/locking/lockdep.c:5565 [inline] lock_acquire+0x197/0x490 kernel/locking/lockdep.c:5530 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x36/0x60 kernel/locking/spinlock.c:159 __wake_up_common_lock+0xb4/0x140 kernel/sched/wait.c:122 pty_flush_buffer+0x124/0x160 drivers/tty/pty.c:225 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+0x1259/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+0x1e5b/0x2b80 drivers/tty/n_tty.c:1737 tiocsti drivers/tty/tty_io.c:2277 [inline] tty_ioctl+0x51b/0x1840 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+0x19a/0x210 fs/ioctl.c:739 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xc6 other info that might help us debug this: Chain exists of: &tty->read_wait --> &sighand->siglock --> &tty->ctrl_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&tty->ctrl_lock); lock(&sighand->siglock); lock(&tty->ctrl_lock); lock(&tty->read_wait); *** DEADLOCK *** 4 locks held by syz-executor.3/235203: #0: ffff88804ac1d098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x90 drivers/tty/tty_ldisc.c:266 #1: ffff88800d4360b8 (&port->buf.lock/1){+.+.}-{3:3}, at: tiocsti drivers/tty/tty_io.c:2275 [inline] #1: ffff88800d4360b8 (&port->buf.lock/1){+.+.}-{3:3}, at: tty_ioctl+0x4ae/0x1840 drivers/tty/tty_io.c:2658 #2: ffff88804ac1d2e8 (&o_tty->termios_rwsem/1){++++}-{3:3}, at: isig+0xe5/0x430 drivers/tty/n_tty.c:1126 #3: ffff88804ac1d3b8 (&tty->ctrl_lock){....}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:379 [inline] #3: ffff88804ac1d3b8 (&tty->ctrl_lock){....}-{2:2}, at: pty_flush_buffer+0xaf/0x160 drivers/tty/pty.c:223 stack backtrace: CPU: 1 PID: 235203 Comm: syz-executor.3 Not tainted 5.10.155 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x167 lib/dump_stack.c:118 check_noncircular+0x263/0x2e0 kernel/locking/lockdep.c:2123 check_prev_add kernel/locking/lockdep.c:2988 [inline] check_prevs_add kernel/locking/lockdep.c:3113 [inline] validate_chain kernel/locking/lockdep.c:3728 [inline] __lock_acquire+0x29e7/0x5b00 kernel/locking/lockdep.c:4954 lock_acquire kernel/locking/lockdep.c:5565 [inline] lock_acquire+0x197/0x490 kernel/locking/lockdep.c:5530 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x36/0x60 kernel/locking/spinlock.c:159 __wake_up_common_lock+0xb4/0x140 kernel/sched/wait.c:122 pty_flush_buffer+0x124/0x160 drivers/tty/pty.c:225 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+0x1259/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+0x1e5b/0x2b80 drivers/tty/n_tty.c:1737 tiocsti drivers/tty/tty_io.c:2277 [inline] tty_ioctl+0x51b/0x1840 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+0x19a/0x210 fs/ioctl.c:739 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xc6 RIP: 0033:0x7fa8ec693b19 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:00007fa8e9c09188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fa8ec7a6f60 RCX: 00007fa8ec693b19 RDX: 0000000020000100 RSI: 0000000000005412 RDI: 0000000000000004 RBP: 00007fa8ec6edf6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe6ee117bf R14: 00007fa8e9c09300 R15: 0000000000022000 EXT4-fs warning (device sda): verify_group_input:170: Bad blocks count 0 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pid=236215 comm=syz-executor.4 mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium netlink: 8 bytes leftover after parsing attributes in process `syz-executor.7'. mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium netlink: 8 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.7'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.7'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.7'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'. audit: type=1326 audit(1668876418.954:207): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=238910 comm="syz-executor.5" exe="/syz-executor.5" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f7b5c9f1b19 code=0x7ffc0000 audit: type=1326 audit(1668876418.954:208): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=238910 comm="syz-executor.5" exe="/syz-executor.5" sig=0 arch=c000003e syscall=202 compat=0 ip=0x7f7b5c9f1b19 code=0x7ffc0000 blktrace: Concurrent blktraces are not allowed on loop10 ieee80211 phy64: Selected rate control algorithm 'minstrel_ht' ieee80211 phy65: Selected rate control algorithm 'minstrel_ht' ieee80211 phy66: Selected rate control algorithm 'minstrel_ht' ieee80211 phy67: Selected rate control algorithm 'minstrel_ht' EXT4-fs (loop1): mounted filesystem without journal. Opts: ,errors=continue EXT4-fs (loop1): mounted filesystem without journal. Opts: ,errors=continue device veth0_vlan entered promiscuous mode EXT4-fs (loop1): mounted filesystem without journal. Opts: ,errors=continue platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 EXT4-fs warning (device sda): verify_group_input:146: Cannot add at group 18 (only 16 groups) EXT4-fs warning (device sda): verify_group_input:146: Cannot add at group 18 (only 16 groups) EXT4-fs warning (device sda): verify_group_input:146: Cannot add at group 18 (only 16 groups) __nla_validate_parse: 3 callbacks suppressed netlink: 9 bytes leftover after parsing attributes in process `syz-executor.1'. FAULT_INJECTION: forcing a failure. name fail_usercopy, interval 1, probability 0, space 0, times 1 CPU: 1 PID: 243300 Comm: syz-executor.3 Not tainted 5.10.155 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x167 lib/dump_stack.c:118 fail_dump lib/fault-inject.c:52 [inline] should_fail.cold+0x5/0xa lib/fault-inject.c:146 _copy_from_user+0x2e/0x1b0 lib/usercopy.c:14 copy_from_user include/linux/uaccess.h:192 [inline] __copy_msghdr_from_user+0x91/0x4b0 net/socket.c:2224 copy_msghdr_from_user net/socket.c:2275 [inline] sendmsg_copy_msghdr+0xa1/0x160 net/socket.c:2373 ___sys_sendmsg+0xc6/0x170 net/socket.c:2392 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2429 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xc6 RIP: 0033:0x7fa8ec693b19 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:00007fa8e9c09188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fa8ec7a6f60 RCX: 00007fa8ec693b19 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000003 RBP: 00007fa8e9c091d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffe6ee117bf R14: 00007fa8e9c09300 R15: 0000000000022000 netlink: 8 bytes leftover after parsing attributes in process `syz-executor.1'. EXT4-fs warning (device sda): verify_group_input:146: Cannot add at group 18 (only 16 groups) mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium FAT-fs (loop6): Directory bread(block 3) failed FAT-fs (loop6): Directory bread(block 4) failed FAT-fs (loop6): Directory bread(block 5) failed FAT-fs (loop6): Directory bread(block 6) failed FAT-fs (loop6): Directory bread(block 3) failed FAT-fs (loop6): Directory bread(block 4) failed FAT-fs (loop6): Directory bread(block 5) failed FAT-fs (loop6): Directory bread(block 6) failed mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium FAT-fs (loop6): Directory bread(block 3) failed FAT-fs (loop6): Directory bread(block 4) failed FAT-fs (loop6): Directory bread(block 5) failed FAT-fs (loop6): Directory bread(block 6) failed mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium mac80211_hwsim: wmediumd released netlink socket, switching to perfect channel medium FAT-fs (loop6): Directory bread(block 3) failed FAT-fs (loop6): Directory bread(block 4) failed FAT-fs (loop6): Directory bread(block 5) failed FAT-fs (loop6): Directory bread(block 6) failed