====================================================== WARNING: possible circular locking dependency detected 5.10.109 #1 Not tainted ------------------------------------------------------ syz-executor.5/20877 is trying to acquire lock: ffff8880458af578 (&tty->read_wait){....}-{2:2}, at: __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:122 but task is already holding lock: ffff8880458ac3b8 (&tty->ctrl_lock){....}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:379 [inline] ffff8880458ac3b8 (&tty->ctrl_lock){....}-{2:2}, at: pty_flush_buffer+0xaf/0x160 drivers/tty/pty.c:233 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/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 -> #1 (&sighand->siglock){-...}-{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 __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_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+0x120e/0x1830 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+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 (&tty->read_wait){....}-{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 __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 tty_ldisc_hangup+0xdb/0x690 drivers/tty/tty_ldisc.c:726 __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+0x120e/0x1830 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+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: &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 *** 3 locks held by syz-executor.5/20877: #0: ffff8880458ac1c0 (&tty->legacy_mutex/1){+.+.}-{3:3}, at: tty_lock+0xbd/0x120 drivers/tty/tty_mutex.c:19 #1: ffff8880458ac098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref drivers/tty/tty_ldisc.c:287 [inline] #1: ffff8880458ac098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_hangup+0x2c/0x690 drivers/tty/tty_ldisc.c:722 #2: ffff8880458ac3b8 (&tty->ctrl_lock){....}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:379 [inline] #2: ffff8880458ac3b8 (&tty->ctrl_lock){....}-{2:2}, at: pty_flush_buffer+0xaf/0x160 drivers/tty/pty.c:233 stack backtrace: CPU: 0 PID: 20877 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 __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 tty_ldisc_hangup+0xdb/0x690 drivers/tty/tty_ldisc.c:726 __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+0x120e/0x1830 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+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:0x7fc2d7c16b19 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:00007fc2d518c188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fc2d7d29f60 RCX: 00007fc2d7c16b19 RDX: 0000000000000000 RSI: 0000000000005437 RDI: 0000000000000006 RBP: 00007fc2d7c70f6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe52782a4f R14: 00007fc2d518c300 R15: 0000000000022000 EXT4-fs (loop4): Unrecognized mount option "K7PGczgDaɸ2b/:?t=Cȟ[V߁QYUEB&%hC *́XRFkx%6xHV2s]ކ󲯨Gb)y']ɋ`8Y=:?FMT PM[$S}(CCjldNFXsQVm Hga鱇fQ" or missing value syz-executor.3 invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=1000 CPU: 1 PID: 20873 Comm: syz-executor.3 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 dump_header+0x106/0x613 mm/oom_kill.c:461 oom_kill_process.cold+0x10/0x15 mm/oom_kill.c:978 out_of_memory+0x358/0x1400 mm/oom_kill.c:1115 mem_cgroup_out_of_memory+0x1e5/0x250 mm/memcontrol.c:1732 mem_cgroup_oom mm/memcontrol.c:1967 [inline] try_charge+0xcd5/0x1190 mm/memcontrol.c:2792 mem_cgroup_charge+0x9e/0x960 mm/memcontrol.c:6799 do_anonymous_page mm/memory.c:3587 [inline] handle_pte_fault mm/memory.c:4433 [inline] __handle_mm_fault mm/memory.c:4570 [inline] handle_mm_fault+0x15a8/0x3540 mm/memory.c:4668 faultin_page mm/gup.c:879 [inline] __get_user_pages+0x61d/0x1410 mm/gup.c:1091 populate_vma_page_range+0x24d/0x330 mm/gup.c:1424 __mm_populate+0x1ea/0x350 mm/gup.c:1472 mm_populate include/linux/mm.h:2609 [inline] __do_sys_mlockall+0x445/0x520 mm/mlock.c:828 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f3351f88b19 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:00007f334f4fe188 EFLAGS: 00000246 ORIG_RAX: 0000000000000097 RAX: ffffffffffffffda RBX: 00007f335209bf60 RCX: 00007f3351f88b19 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 00007f3351fe2f6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffab38015f R14: 00007f334f4fe300 R15: 0000000000022000 memory: usage 307200kB, limit 307200kB, failcnt 2209 swap: usage 0kB, limit 9007199254740988kB, failcnt 0 Memory cgroup stats for /syz3: anon 284663808 file 20275200 kernel_stack 983040 percpu 0 sock 0 shmem 0 file_mapped 20545536 file_dirty 0 file_writeback 135168 inactive_anon 258576384 active_anon 0 inactive_file 131072 active_file 20480 unevictable 46768128 slab_reclaimable 258768 slab_unreclaimable 3445168 slab 3703936 workingset_refault_anon 0 workingset_refault_file 924 workingset_activate_anon 0 workingset_activate_file 0 workingset_restore_anon 0 workingset_restore_file 0 workingset_nodereclaim 0 pgfault 384945 pgmajfault 0 pgrefill 957 pgscan 967 pgsteal 933 pgactivate 236973 oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz3,mems_allowed=0,oom_memcg=/syz3,task_memcg=/syz3,task=syz-executor.3,pid=20868,uid=0 Memory cgroup out of memory: Killed process 20868 (syz-executor.3) total-vm:93412kB, anon-rss:25696kB, file-rss:55636kB, shmem-rss:0kB, UID:0 pgtables:216kB oom_score_adj:1000 oom_reaper: reaped process 20868 (syz-executor.3), now anon-rss:25736kB, file-rss:56456kB, shmem-rss:0kB PM: hibernation: Basic memory bitmaps freed PM: hibernation: Marking nosave pages: [mem 0x00000000-0x00000fff] PM: hibernation: Marking nosave pages: [mem 0x0009f000-0x000fffff] PM: hibernation: Basic memory bitmaps created PM: hibernation: Basic memory bitmaps freed syz-executor.3 invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=1000 CPU: 0 PID: 21002 Comm: syz-executor.3 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 dump_header+0x106/0x613 mm/oom_kill.c:461 oom_kill_process.cold+0x10/0x15 mm/oom_kill.c:978 out_of_memory+0x358/0x1400 mm/oom_kill.c:1115 mem_cgroup_out_of_memory+0x1e5/0x250 mm/memcontrol.c:1732 mem_cgroup_oom mm/memcontrol.c:1967 [inline] try_charge+0xcd5/0x1190 mm/memcontrol.c:2792 mem_cgroup_charge+0x9e/0x960 mm/memcontrol.c:6799 do_anonymous_page mm/memory.c:3587 [inline] handle_pte_fault mm/memory.c:4433 [inline] __handle_mm_fault mm/memory.c:4570 [inline] handle_mm_fault+0x15a8/0x3540 mm/memory.c:4668 faultin_page mm/gup.c:879 [inline] __get_user_pages+0x61d/0x1410 mm/gup.c:1091 populate_vma_page_range+0x24d/0x330 mm/gup.c:1424 __mm_populate+0x1ea/0x350 mm/gup.c:1472 mm_populate include/linux/mm.h:2609 [inline] __do_sys_mlockall+0x445/0x520 mm/mlock.c:828 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f3351f88b19 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:00007f334f4fe188 EFLAGS: 00000246 ORIG_RAX: 0000000000000097 RAX: ffffffffffffffda RBX: 00007f335209bf60 RCX: 00007f3351f88b19 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001 RBP: 00007f3351fe2f6d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffab38015f R14: 00007f334f4fe300 R15: 0000000000022000 memory: usage 307200kB, limit 307200kB, failcnt 2245 swap: usage 0kB, limit 9007199254740988kB, failcnt 0 Memory cgroup stats for /syz3: Process accounting resumed Process accounting resumed audit: type=1326 audit(1653746141.727:189): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=21022 comm="syz-executor.2" exe="/syz-executor.2" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f9a36e51b19 code=0x0 anon 285745152 file 20275200 kernel_stack 983040 percpu 0 sock 0 shmem 0 file_mapped 20410368 file_dirty 0 file_writeback 135168 inactive_anon 258576384 active_anon 0 inactive_file 0 active_file 155648 unevictable 47714304 slab_reclaimable 258768 slab_unreclaimable 2365112 slab 2623880 workingset_refault_anon 0 workingset_refault_file 924 workingset_activate_anon 0 workingset_activate_file 0 workingset_restore_anon 0 workingset_restore_file 0 workingset_nodereclaim 0 pgfault 392007 pgmajfault 0 pgrefill 957 pgscan 967 pgsteal 933 pgactivate 241989 oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz3,mems_allowed=0,oom_memcg=/syz3,task_memcg=/syz3,task=syz-executor.3,pid=20995,uid=0 Memory cgroup out of memory: Killed process 20995 (syz-executor.3) total-vm:93412kB, anon-rss:27020kB, file-rss:55632kB, shmem-rss:0kB, UID:0 pgtables:220kB oom_score_adj:1000 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=4122 sclass=netlink_route_socket pid=21038 comm=syz-executor.6 audit: type=1326 audit(1653746142.461:190): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=21022 comm="syz-executor.2" exe="/syz-executor.2" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f9a36e51b19 code=0x0 wlan0: No active IBSS STAs - trying to scan for other IBSS networks with same SSID (merge)