syzbot


possible deadlock in try_to_wake_up

Status: upstream: reported C repro on 2024/04/05 17:03
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+534c8598d72f81135bab@syzkaller.appspotmail.com
First crash: 164d, last: 18d
Bug presence (1)
Date Name Commit Repro Result
2024/05/10 upstream (ToT) 448b3fe5a0ea C [report] inconsistent lock state in valid_state
Similar bugs (8)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in try_to_wake_up (2) origin:upstream C 20 12d 130d 0/3 upstream: reported C repro on 2024/05/09 05:15
linux-6.1 possible deadlock in try_to_wake_up C done 1 173d 173d 3/3 fixed on 2024/04/29 07:11
upstream possible deadlock in try_to_wake_up (2) mm 1 729d 725d 0/28 auto-obsoleted due to no activity on 2023/01/16 12:10
upstream possible deadlock in try_to_wake_up (4) bpf net C error 19 119d 182d 25/28 fixed on 2024/05/22 23:36
upstream possible deadlock in try_to_wake_up (5) mm C 88 36d 109d 27/28 fixed on 2024/08/14 03:44
upstream possible deadlock in try_to_wake_up (3) net 103 334d 344d 0/28 auto-obsoleted due to no activity on 2023/11/27 02:05
upstream possible deadlock in try_to_wake_up mm 39 2072d 2104d 0/28 auto-closed as invalid on 2019/07/13 09:55
upstream possible deadlock in try_to_wake_up (6) kernel 1 19d 15d 0/28 upstream: reported on 2024/09/01 05:41
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2024/06/09 19:39 1h06m bisect fix linux-5.15.y OK (0) job log log

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
5.15.164-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor330/3661 is trying to acquire lock:
ffff88813fe227e8 (&p->pi_lock){-.-.}-{2:2}, at: try_to_wake_up+0xae/0x1300 kernel/sched/core.c:4030

but task is already holding lock:
ffff8880b9a35bb8 (lock#8){+.+.}-{2:2}, at: local_lock_acquire+0xd/0x170 include/linux/local_lock_internal.h:28

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (lock#8){+.+.}-{2:2}:
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
       local_lock_acquire+0x29/0x170 include/linux/local_lock_internal.h:29
       __mmap_lock_do_trace_acquire_returned+0x7c/0x340 mm/mmap_lock.c:237
       __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
       mmap_read_trylock include/linux/mmap_lock.h:137 [inline]
       stack_map_get_build_id_offset+0x612/0x930 kernel/bpf/stackmap.c:185
       __bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:496
       ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1490 [inline]
       bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1480
       0xffffffffa0014c2a
       bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline]
       __bpf_prog_run include/linux/filter.h:628 [inline]
       bpf_prog_run include/linux/filter.h:635 [inline]
       __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
       bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1917
       trace_tlb_flush+0xed/0x110 include/trace/events/tlb.h:38
       switch_mm_irqs_off+0x748/0xa30
       context_switch kernel/sched/core.c:5016 [inline]
       __schedule+0x1167/0x45b0 kernel/sched/core.c:6376
       schedule+0x11b/0x1f0 kernel/sched/core.c:6459
       schedule_hrtimeout_range_clock+0x2b3/0x4a0 kernel/time/hrtimer.c:2308
       poll_schedule_timeout+0x10c/0x150 fs/select.c:243
       do_poll fs/select.c:964 [inline]
       do_sys_poll+0xd61/0x11f0 fs/select.c:1014
       __do_sys_ppoll fs/select.c:1120 [inline]
       __se_sys_ppoll+0x29c/0x330 fs/select.c:1100
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #1 (&rq->__lock){-.-.}-{2:2}:
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
       _raw_spin_lock_nested+0x2d/0x40 kernel/locking/spinlock.c:368
       raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:475
       raw_spin_rq_lock kernel/sched/sched.h:1326 [inline]
       rq_lock kernel/sched/sched.h:1621 [inline]
       task_fork_fair+0x5d/0x350 kernel/sched/fair.c:11495
       sched_cgroup_fork+0x2d3/0x330 kernel/sched/core.c:4466
       copy_process+0x224a/0x3ef0 kernel/fork.c:2320
       kernel_clone+0x210/0x960 kernel/fork.c:2604
       kernel_thread+0x168/0x1e0 kernel/fork.c:2656
       rest_init+0x21/0x330 init/main.c:706
       start_kernel+0x48c/0x540 init/main.c:1140
       secondary_startup_64_no_verify+0xb1/0xbb

-> #0 (&p->pi_lock){-.-.}-{2:2}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788
       __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
       try_to_wake_up+0xae/0x1300 kernel/sched/core.c:4030
       rcu_read_unlock_special+0x3aa/0x520 kernel/rcu/tree_plugin.h:650
       __rcu_read_unlock+0x92/0x100 kernel/rcu/tree_plugin.h:422
       rcu_read_unlock include/linux/rcupdate.h:771 [inline]
       get_mem_cgroup_from_mm+0x179/0x260 mm/memcontrol.c:992
       get_mm_memcg_path+0x1b/0x550 mm/mmap_lock.c:202
       __mmap_lock_do_trace_acquire_returned+0x84/0x340 mm/mmap_lock.c:237
       __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
       mmap_read_lock include/linux/mmap_lock.h:118 [inline]
       acct_collect+0x772/0x7a0 kernel/acct.c:543
       do_exit+0x5a2/0x2480 kernel/exit.c:853
       do_group_exit+0x144/0x310 kernel/exit.c:996
       __do_sys_exit_group kernel/exit.c:1007 [inline]
       __se_sys_exit_group kernel/exit.c:1005 [inline]
       __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1005
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

Chain exists of:
  &p->pi_lock --> &rq->__lock --> lock#8

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(lock#8);
                               lock(&rq->__lock);
                               lock(lock#8);
  lock(&p->pi_lock);

 *** DEADLOCK ***

3 locks held by syz-executor330/3661:
 #0: ffff888078380828 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:117 [inline]
 #0: ffff888078380828 (&mm->mmap_lock){++++}-{3:3}, at: acct_collect+0x15c/0x7a0 kernel/acct.c:543
 #1: ffff8880b9a35bb8 (lock#8){+.+.}-{2:2}, at: local_lock_acquire+0xd/0x170 include/linux/local_lock_internal.h:28
 #2: ffffffff8c91fb20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x0/0x30

stack backtrace:
CPU: 0 PID: 3661 Comm: syz-executor330 Not tainted 5.15.164-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 check_noncircular+0x2f8/0x3b0 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+0x1649/0x5930 kernel/locking/lockdep.c:3788
 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
 try_to_wake_up+0xae/0x1300 kernel/sched/core.c:4030
 rcu_read_unlock_special+0x3aa/0x520 kernel/rcu/tree_plugin.h:650
 __rcu_read_unlock+0x92/0x100 kernel/rcu/tree_plugin.h:422
 rcu_read_unlock include/linux/rcupdate.h:771 [inline]
 get_mem_cgroup_from_mm+0x179/0x260 mm/memcontrol.c:992
 get_mm_memcg_path+0x1b/0x550 mm/mmap_lock.c:202
 __mmap_lock_do_trace_acquire_returned+0x84/0x340 mm/mmap_lock.c:237
 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
 mmap_read_lock include/linux/mmap_lock.h:118 [inline]
 acct_collect+0x772/0x7a0 kernel/acct.c:543
 do_exit+0x5a2/0x2480 kernel/exit.c:853
 do_group_exit+0x144/0x310 kernel/exit.c:996
 __do_sys_exit_group kernel/exit.c:1007 [inline]
 __se_sys_exit_group kernel/exit.c:1005 [inline]
 __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1005
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f84b99a3439
Code: 90 49 c7 c0 b8 ff ff ff be e7 00 00 00 ba 3c 00 00 00 eb 12 0f 1f 44 00 00 89 d0 0f 05 48 3d 00 f0 ff ff 77 1c f4 89 f0 0f 05 <48> 3d 00 f0 ff ff 76 e7 f7 d8 64 41 89 00 eb df 0f 1f 80 00 00 00
RSP: 002b:00007fff523d3888 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f84b99a3439
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 00007f84b9a1e2d0 R08: ffffffffffffffb8 R09: 00000000000000a0
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f84b9a1e2d0
R13: 0000000000000000 R14: 00007f84b9a1ed40 R15: 00007f84b99745e0
 </TASK>

Crashes (31):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/08/10 19:01 linux-5.15.y 7e89efd3ae1c 6f4edef4 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/08/10 16:58 linux-5.15.y 7e89efd3ae1c 6f4edef4 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/08/02 15:47 linux-5.15.y 7e89efd3ae1c 1e9c4cf3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in try_to_wake_up
2024/05/09 20:40 linux-5.15.y 284087d4f7d5 05079661 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in try_to_wake_up
2024/08/29 11:47 linux-5.15.y fa93fa65db6e ef3de9e8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/08/13 13:35 linux-5.15.y 7e89efd3ae1c f21a18ca .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/08/13 04:33 linux-5.15.y 7e89efd3ae1c 7b0f4b46 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/08/13 04:33 linux-5.15.y 7e89efd3ae1c 7b0f4b46 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/08/12 05:33 linux-5.15.y 7e89efd3ae1c 6f4edef4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/08/08 01:11 linux-5.15.y 7e89efd3ae1c de12cf65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in try_to_wake_up
2024/08/04 23:41 linux-5.15.y 7e89efd3ae1c 1786a2a8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/08/04 18:45 linux-5.15.y 7e89efd3ae1c 1786a2a8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/07/30 18:37 linux-5.15.y 7e89efd3ae1c 6fde257d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/07/29 04:40 linux-5.15.y 7e89efd3ae1c 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/07/29 04:39 linux-5.15.y 7e89efd3ae1c 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/07/28 11:43 linux-5.15.y 7e89efd3ae1c 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in try_to_wake_up
2024/07/25 12:30 linux-5.15.y 7c6d66f0266f 466a14e5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in try_to_wake_up
2024/07/24 18:17 linux-5.15.y 7c6d66f0266f d1a1b0ca .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in try_to_wake_up
2024/07/24 01:00 linux-5.15.y 7c6d66f0266f e50e8da5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in try_to_wake_up
2024/07/23 00:36 linux-5.15.y 7c6d66f0266f 708c10c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in try_to_wake_up
2024/07/21 09:52 linux-5.15.y 7c6d66f0266f b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/07/19 16:24 linux-5.15.y 7c6d66f0266f 890ce4f3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in try_to_wake_up
2024/07/19 04:10 linux-5.15.y 7c6d66f0266f ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in try_to_wake_up
2024/07/17 13:03 linux-5.15.y f45bea23c39c 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in try_to_wake_up
2024/07/08 13:10 linux-5.15.y f45bea23c39c cde64f7d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in try_to_wake_up
2024/06/15 19:25 linux-5.15.y c61bd26ae81a f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/06/11 23:45 linux-5.15.y c61bd26ae81a 4d75f4f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/04/18 13:33 linux-5.15.y c52b9710c83d af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/04/17 19:28 linux-5.15.y c52b9710c83d acc528cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/04/11 06:24 linux-5.15.y cdfd0a7f0139 33b9e058 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
2024/04/05 17:02 linux-5.15.y 9465fef4ae35 77230c29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in try_to_wake_up
* Struck through repros no longer work on HEAD.