syzbot


BUG: using __this_cpu_add() in preemptible code in graph_lock

Status: upstream: reported on 2024/04/22 07:20
Subsystems: perf
[Documentation on labels]
Reported-by: syzbot+60761fc6ef65e4f00974@syzkaller.appspotmail.com
First crash: 42d, last: 42d
Discussions (2)
Title Replies (including bot) Last reply
Re: [syzbot] [perf?] BUG: using __this_cpu_add() in preemptible code in graph_lock 1 (1) 2024/04/26 01:42
[syzbot] [perf?] BUG: using __this_cpu_add() in preemptible code in graph_lock 0 (1) 2024/04/22 07:20

Sample crash report:
BUG: using __this_cpu_add() in preemptible [00000000] code: syz-executor.3/9981
caller is __pv_queued_spin_lock_slowpath+0x945/0xc60 kernel/locking/qspinlock.c:565
CPU: 0 PID: 9981 Comm: syz-executor.3 Not tainted 6.8.0-syzkaller-05236-g443574b03387 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2e0 lib/dump_stack.c:106
 check_preemption_disabled+0x10e/0x120 lib/smp_processor_id.c:49
 __pv_queued_spin_lock_slowpath+0x945/0xc60 kernel/locking/qspinlock.c:565
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:584 [inline]
 queued_spin_lock_slowpath+0x42/0x50 arch/x86/include/asm/qspinlock.h:51
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 lockdep_lock+0x1b0/0x2b0 kernel/locking/lockdep.c:144
 graph_lock+0x5/0x60 kernel/locking/lockdep.c:170
 mark_lock+0x15c/0x350 kernel/locking/lockdep.c:4659
 __lock_acquire+0x116e/0x1fd0 kernel/locking/lockdep.c:5091
 lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754
 percpu_down_write+0x57/0x320 kernel/locking/percpu-rwsem.c:229
 bp_constraints_lock+0xdd/0x1c0 kernel/events/hw_breakpoint.c:133
 reserve_bp_slot kernel/events/hw_breakpoint.c:600 [inline]
 register_perf_hw_breakpoint+0x90/0x250 kernel/events/hw_breakpoint.c:718
 hw_breakpoint_event_init+0x8d/0x110 kernel/events/hw_breakpoint.c:958
 perf_try_init_event+0x139/0x3f0 kernel/events/core.c:11668
 perf_init_event kernel/events/core.c:11738 [inline]
 perf_event_alloc+0xeed/0x2130 kernel/events/core.c:12018
 __do_sys_perf_event_open kernel/events/core.c:12525 [inline]
 __se_sys_perf_event_open+0x7f9/0x38d0 kernel/events/core.c:12416
 do_syscall_64+0xfb/0x240
 entry_SYSCALL_64_after_hwframe+0x6d/0x75
RIP: 0033:0x7f4f88a7dea9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f4f897950c8 EFLAGS: 00000246 ORIG_RAX: 000000000000012a
RAX: ffffffffffffffda RBX: 00007f4f88babf80 RCX: 00007f4f88a7dea9
RDX: 0000000000000000 RSI: ffffffffffffffff RDI: 0000000020000180
RBP: 00007f4f88aca4a4 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f4f88babf80 R15: 00007fffadfb1b08
 </TASK>

=============================
WARNING: suspicious RCU usage
6.8.0-syzkaller-05236-g443574b03387 #0 Not tainted
-----------------------------
kernel/sched/core.c:5982 Illegal context switch in RCU-bh read-side critical section!

other info that might help us debug this:


rcu_scheduler_active = 2, debug_locks = 1
1 lock held by syz-executor.3/9981:
 #0: ffffffff94511910 (&pmus_srcu){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:116 [inline]
 #0: ffffffff94511910 (&pmus_srcu){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:215 [inline]
 #0: ffffffff94511910 (&pmus_srcu){.+.+}-{0:0}, at: perf_init_event kernel/events/core.c:11698 [inline]
 #0: ffffffff94511910 (&pmus_srcu){.+.+}-{0:0}, at: perf_event_alloc+0xacf/0x2130 kernel/events/core.c:12018

stack backtrace:
CPU: 0 PID: 9981 Comm: syz-executor.3 Not tainted 6.8.0-syzkaller-05236-g443574b03387 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2e0 lib/dump_stack.c:106
 lockdep_rcu_suspicious+0x221/0x340 kernel/locking/lockdep.c:6712
 schedule_debug kernel/sched/core.c:5982 [inline]
 __schedule+0x23b/0x4a20 kernel/sched/core.c:6629
 preempt_schedule_common+0x84/0xd0 kernel/sched/core.c:6915
 preempt_schedule+0xe1/0xf0 kernel/sched/core.c:6939
 preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk_64.S:12
 unwind_next_frame+0x2124/0x2a00 arch/x86/kernel/unwind_orc.c:672
 __unwind_start+0x641/0x7c0 arch/x86/kernel/unwind_orc.c:760
 unwind_start arch/x86/include/asm/unwind.h:64 [inline]
 arch_stack_walk+0x103/0x1b0 arch/x86/kernel/stacktrace.c:24
 stack_trace_save+0x118/0x1d0 kernel/stacktrace.c:122
 save_trace+0x5a/0xb40 kernel/locking/lockdep.c:582
 mark_lock+0x1d3/0x350 kernel/locking/lockdep.c:4673
 __lock_acquire+0x116e/0x1fd0 kernel/locking/lockdep.c:5091
 lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754
 percpu_down_write+0x57/0x320 kernel/locking/percpu-rwsem.c:229
 bp_constraints_lock+0xdd/0x1c0 kernel/events/hw_breakpoint.c:133
 reserve_bp_slot kernel/events/hw_breakpoint.c:600 [inline]
 register_perf_hw_breakpoint+0x90/0x250 kernel/events/hw_breakpoint.c:718
 hw_breakpoint_event_init+0x8d/0x110 kernel/events/hw_breakpoint.c:958
 perf_try_init_event+0x139/0x3f0 kernel/events/core.c:11668
 perf_init_event kernel/events/core.c:11738 [inline]
 perf_event_alloc+0xeed/0x2130 kernel/events/core.c:12018
 __do_sys_perf_event_open kernel/events/core.c:12525 [inline]
 __se_sys_perf_event_open+0x7f9/0x38d0 kernel/events/core.c:12416
 do_syscall_64+0xfb/0x240
 entry_SYSCALL_64_after_hwframe+0x6d/0x75
RIP: 0033:0x7f4f88a7dea9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f4f897950c8 EFLAGS: 00000246 ORIG_RAX: 000000000000012a
RAX: ffffffffffffffda RBX: 00007f4f88babf80 RCX: 00007f4f88a7dea9
RDX: 0000000000000000 RSI: ffffffffffffffff RDI: 0000000020000180
RBP: 00007f4f88aca4a4 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f4f88babf80 R15: 00007fffadfb1b08
 </TASK>

=============================
WARNING: suspicious RCU usage
6.8.0-syzkaller-05236-g443574b03387 #0 Not tainted
-----------------------------
kernel/sched/core.c:5982 Illegal context switch in RCU-sched read-side critical section!

other info that might help us debug this:


rcu_scheduler_active = 2, debug_locks = 1
1 lock held by syz-executor.3/9981:
 #0: ffffffff94511910 (&pmus_srcu){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:116 [inline]
 #0: ffffffff94511910 (&pmus_srcu){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:215 [inline]
 #0: ffffffff94511910 (&pmus_srcu){.+.+}-{0:0}, at: perf_init_event kernel/events/core.c:11698 [inline]
 #0: ffffffff94511910 (&pmus_srcu){.+.+}-{0:0}, at: perf_event_alloc+0xacf/0x2130 kernel/events/core.c:12018

stack backtrace:
CPU: 0 PID: 9981 Comm: syz-executor.3 Not tainted 6.8.0-syzkaller-05236-g443574b03387 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2e0 lib/dump_stack.c:106
 lockdep_rcu_suspicious+0x221/0x340 kernel/locking/lockdep.c:6712
 schedule_debug kernel/sched/core.c:5982 [inline]
 __schedule+0x28a/0x4a20 kernel/sched/core.c:6629
 preempt_schedule_common+0x84/0xd0 kernel/sched/core.c:6915
 preempt_schedule+0xe1/0xf0 kernel/sched/core.c:6939
 preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk_64.S:12
 unwind_next_frame+0x2124/0x2a00 arch/x86/kernel/unwind_orc.c:672
 __unwind_start+0x641/0x7c0 arch/x86/kernel/unwind_orc.c:760
 unwind_start arch/x86/include/asm/unwind.h:64 [inline]
 arch_stack_walk+0x103/0x1b0 arch/x86/kernel/stacktrace.c:24
 stack_trace_save+0x118/0x1d0 kernel/stacktrace.c:122
 save_trace+0x5a/0xb40 kernel/locking/lockdep.c:582
 mark_lock+0x1d3/0x350 kernel/locking/lockdep.c:4673
 __lock_acquire+0x116e/0x1fd0 kernel/locking/lockdep.c:5091
 lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754
 percpu_down_write+0x57/0x320 kernel/locking/percpu-rwsem.c:229
 bp_constraints_lock+0xdd/0x1c0 kernel/events/hw_breakpoint.c:133
 reserve_bp_slot kernel/events/hw_breakpoint.c:600 [inline]
 register_perf_hw_breakpoint+0x90/0x250 kernel/events/hw_breakpoint.c:718
 hw_breakpoint_event_init+0x8d/0x110 kernel/events/hw_breakpoint.c:958
 perf_try_init_event+0x139/0x3f0 kernel/events/core.c:11668
 perf_init_event kernel/events/core.c:11738 [inline]
 perf_event_alloc+0xeed/0x2130 kernel/events/core.c:12018
 __do_sys_perf_event_open kernel/events/core.c:12525 [inline]
 __se_sys_perf_event_open+0x7f9/0x38d0 kernel/events/core.c:12416
 do_syscall_64+0xfb/0x240
 entry_SYSCALL_64_after_hwframe+0x6d/0x75
RIP: 0033:0x7f4f88a7dea9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f4f897950c8 EFLAGS: 00000246 ORIG_RAX: 000000000000012a
RAX: ffffffffffffffda RBX: 00007f4f88babf80 RCX: 00007f4f88a7dea9
RDX: 0000000000000000 RSI: ffffffffffffffff RDI: 0000000020000180
RBP: 00007f4f88aca4a4 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f4f88babf80 R15: 00007fffadfb1b08
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/18 07:13 bpf 443574b03387 bd38b692 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce BUG: using __this_cpu_add() in preemptible code in graph_lock
* Struck through repros no longer work on HEAD.