WARNING: CPU: 1 PID: 13238 at kernel/events/core.c:331 event_function_local.constprop.115+0x520/0x5c0 kernel/events/core.c:331
Kernel panic - not syncing: panic_on_warn set ...
CPU: 1 PID: 13238 Comm: syz-executor2 Not tainted 4.17.0+ #39
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1b9/0x294 lib/dump_stack.c:113
panic+0x22f/0x4de kernel/panic.c:184
__warn.cold.8+0x163/0x1b3 kernel/panic.c:536
report_bug+0x252/0x2d0 lib/bug.c:186
fixup_bug arch/x86/kernel/traps.c:178 [inline]
do_error_trap+0x1fc/0x4d0 arch/x86/kernel/traps.c:296
do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316
invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:992
RIP: 0010:event_function_local.constprop.115+0x520/0x5c0 kernel/events/core.c:331
Code: 00 48 8b 95 70 ff ff ff e9 b8 fc ff ff 48 89 85 70 ff ff ff e8 71 b5 25 00 48 8b 85 70 ff ff ff e9 f6 fc ff ff e8 80 8b e8 ff <0f> 0b e9 6d fe ff ff 48 8b bd 68 ff ff ff e8 6d b5 25 00 48 8d 55
RSP: 0018:ffff8801daf07cf8 EFLAGS: 00010006
RAX: ffff880199bb4500 RBX: ffff8801c4ea3080 RCX: ffffffff8191b01a
RDX: 0000000000010000 RSI: ffffffff8191b210 RDI: 0000000000000005
RBP: ffff8801daf07d98 R08: ffff880199bb4500 R09: ffffed00389d4611
R10: ffffed00389d4611 R11: ffff8801c4ea308b R12: 1ffff1003b5e0fa2
R13: ffff8801daf31a00 R14: ffff8801c9bcc2c0 R15: ffff8801af664d00
perf_event_disable_local kernel/events/core.c:2180 [inline]
perf_pending_event+0x242/0x2a0 kernel/events/core.c:5811
irq_work_run_list+0x1b4/0x270 kernel/irq_work.c:155
irq_work_run+0x1d/0x50 kernel/irq_work.c:170
smp_irq_work_interrupt+0x10a/0x650 arch/x86/kernel/irq_work.c:21
irq_work_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894
RIP: 0010:arch_local_irq_enable arch/x86/include/asm/paravirt.h:793 [inline]
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x56/0x70 kernel/locking/spinlock.c:192
Code: f1 88 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 75 1d 48 83 3d 3b dc 6e 01 00 74 11 fb 66 0f 1f 44 00 00 <65> ff 0d 83 21 7f 78 5b 5d c3 0f 0b e8 39 9b 34 fa eb dc 0f 1f 80
RSP: 0018:ffff88019630fd50 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff09
RAX: dffffc0000000000 RBX: ffff8801a9dffc08 RCX: 0000000000000000
RDX: 1ffffffff11e350f RSI: 0000000000000001 RDI: ffffffff88f1a878
RBP: ffff88019630fd58 R08: ffffed00353bff82 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff8801a9dffc08
R13: ffff8801c65d7740 R14: ffff8801c65d77d0 R15: ffff8801c65d77dc
spin_unlock_irq include/linux/spinlock.h:360 [inline]
do_group_exit+0x357/0x430 kernel/exit.c:965
__do_sys_exit_group kernel/exit.c:979 [inline]
__se_sys_exit_group kernel/exit.c:977 [inline]
__x64_sys_exit_group+0x3e/0x50 kernel/exit.c:977
do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x455b29
Code: 1d ba fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 eb b9 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffdbc1c0218 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00000000000000ad RCX: 0000000000455b29
RDX: 000000000001e078 RSI: 0000000000730d98 RDI: 0000000000000000
RBP: 0000000000000013 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000013
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000001380
======================================================
WARNING: possible circular locking dependency detected
4.17.0+ #39 Not tainted
------------------------------------------------------
syz-executor2/13238 is trying to acquire lock:
0000000025111b63 ((console_sem).lock){-.-.}, at: down_trylock+0x13/0x70 kernel/locking/semaphore.c:136
but task is already holding lock:
0000000022495766 (&ctx->lock){-...}, at: perf_ctx_lock kernel/events/core.c:157 [inline]
0000000022495766 (&ctx->lock){-...}, at: event_function_local.constprop.115+0x2a3/0x5c0 kernel/events/core.c:318
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #3 (&ctx->lock){-...}:
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:144
perf_event_context_sched_out kernel/events/core.c:3129 [inline]
__perf_event_task_sched_out+0x12df/0x1a30 kernel/events/core.c:3221
perf_event_task_sched_out include/linux/perf_event.h:1112 [inline]
prepare_task_switch kernel/sched/core.c:2637 [inline]
context_switch kernel/sched/core.c:2823 [inline]
__schedule+0x1027/0x1e70 kernel/sched/core.c:3500
schedule+0xef/0x430 kernel/sched/core.c:3544
freezable_schedule include/linux/freezer.h:172 [inline]
futex_wait_queue_me+0x3e8/0x820 kernel/futex.c:2530
futex_wait+0x450/0x9f0 kernel/futex.c:2645
do_futex+0x336/0x27d0 kernel/futex.c:3527
__do_sys_futex kernel/futex.c:3587 [inline]
__se_sys_futex kernel/futex.c:3555 [inline]
__x64_sys_futex+0x46a/0x680 kernel/futex.c:3555
do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
-> #2 (&rq->lock){-.-.}:
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:144
rq_lock kernel/sched/sched.h:1805 [inline]
task_fork_fair+0x8a/0x660 kernel/sched/fair.c:9953
sched_fork+0x43e/0xb30 kernel/sched/core.c:2380
copy_process.part.38+0x1bf1/0x7180 kernel/fork.c:1765
copy_process kernel/fork.c:1608 [inline]
_do_fork+0x291/0x12a0 kernel/fork.c:2091
kernel_thread+0x34/0x40 kernel/fork.c:2150
rest_init+0x22/0xe4 init/main.c:408
start_kernel+0x906/0x92d init/main.c:738
x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:452
x86_64_start_kernel+0x76/0x79 arch/x86/kernel/head64.c:433
secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:242
-> #1 (&p->pi_lock){-.-.}:
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x96/0xc0 kernel/locking/spinlock.c:152
try_to_wake_up+0xca/0x1280 kernel/sched/core.c:1984
wake_up_process+0x10/0x20 kernel/sched/core.c:2147
__up.isra.1+0x1b8/0x290 kernel/locking/semaphore.c:262
up+0x12f/0x1b0 kernel/locking/semaphore.c:187
__up_console_sem+0xbe/0x1b0 kernel/printk/printk.c:242
console_unlock+0x79a/0x10a0 kernel/printk/printk.c:2411
vprintk_emit+0x6b2/0xde0 kernel/printk/printk.c:1907
vprintk_default+0x28/0x30 kernel/printk/printk.c:1948
vprintk_func+0x7a/0xe7 kernel/printk/printk_safe.c:382
printk+0x9e/0xba kernel/printk/printk.c:1981
load_umh+0x51/0xbd net/bpfilter/bpfilter_kern.c:99
do_one_initcall+0x127/0x913 init/main.c:884
do_initcall_level init/main.c:952 [inline]
do_initcalls init/main.c:960 [inline]
do_basic_setup init/main.c:978 [inline]
kernel_init_freeable+0x49b/0x58e init/main.c:1135
kernel_init+0x11/0x1b3 init/main.c:1061
ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:412
-> #0 ((console_sem).lock){-.-.}:
lock_acquire+0x1dc/0x520 kernel/locking/lockdep.c:3924
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x96/0xc0 kernel/locking/spinlock.c:152
down_trylock+0x13/0x70 kernel/locking/semaphore.c:136
__down_trylock_console_sem+0xae/0x200 kernel/printk/printk.c:225
console_trylock+0x15/0xa0 kernel/printk/printk.c:2230
console_trylock_spinning kernel/printk/printk.c:1643 [inline]
vprintk_emit+0x699/0xde0 kernel/printk/printk.c:1906
vprintk_default+0x28/0x30 kernel/printk/printk.c:1948
vprintk_func+0x7a/0xe7 kernel/printk/printk_safe.c:382
printk+0x9e/0xba kernel/printk/printk.c:1981
__warn.cold.8+0x73/0x1b3 kernel/panic.c:518
report_bug+0x252/0x2d0 lib/bug.c:186
fixup_bug arch/x86/kernel/traps.c:178 [inline]
do_error_trap+0x1fc/0x4d0 arch/x86/kernel/traps.c:296
do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316
invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:992
event_function_local.constprop.115+0x520/0x5c0 kernel/events/core.c:331
perf_event_disable_local kernel/events/core.c:2180 [inline]
perf_pending_event+0x242/0x2a0 kernel/events/core.c:5811
irq_work_run_list+0x1b4/0x270 kernel/irq_work.c:155
irq_work_run+0x1d/0x50 kernel/irq_work.c:170
smp_irq_work_interrupt+0x10a/0x650 arch/x86/kernel/irq_work.c:21
irq_work_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894
arch_local_irq_enable arch/x86/include/asm/paravirt.h:793 [inline]
__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
_raw_spin_unlock_irq+0x56/0x70 kernel/locking/spinlock.c:192
spin_unlock_irq include/linux/spinlock.h:360 [inline]
do_group_exit+0x357/0x430 kernel/exit.c:965
__do_sys_exit_group kernel/exit.c:979 [inline]
__se_sys_exit_group kernel/exit.c:977 [inline]
__x64_sys_exit_group+0x3e/0x50 kernel/exit.c:977
do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
other info that might help us debug this:
Chain exists of:
(console_sem).lock --> &rq->lock --> &ctx->lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&ctx->lock);
lock(&rq->lock);
lock(&ctx->lock);
lock((console_sem).lock);
*** DEADLOCK ***
2 locks held by syz-executor2/13238:
#0: 00000000693b5cca (&cpuctx_lock){-...}, at: perf_ctx_lock kernel/events/core.c:155 [inline]
#0: 00000000693b5cca (&cpuctx_lock){-...}, at: event_function_local.constprop.115+0x282/0x5c0 kernel/events/core.c:318
#1: 0000000022495766 (&ctx->lock){-...}, at: perf_ctx_lock kernel/events/core.c:157 [inline]
#1: 0000000022495766 (&ctx->lock){-...}, at: event_function_local.constprop.115+0x2a3/0x5c0 kernel/events/core.c:318
stack backtrace:
CPU: 1 PID: 13238 Comm: syz-executor2 Not tainted 4.17.0+ #39
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1b9/0x294 lib/dump_stack.c:113
print_circular_bug.isra.36.cold.56+0x1bd/0x27d kernel/locking/lockdep.c:1227
check_prev_add kernel/locking/lockdep.c:1867 [inline]
check_prevs_add kernel/locking/lockdep.c:1980 [inline]
validate_chain kernel/locking/lockdep.c:2421 [inline]
__lock_acquire+0x343e/0x5140 kernel/locking/lockdep.c:3435
lock_acquire+0x1dc/0x520 kernel/locking/lockdep.c:3924
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x96/0xc0 kernel/locking/spinlock.c:152
down_trylock+0x13/0x70 kernel/locking/semaphore.c:136
__down_trylock_console_sem+0xae/0x200 kernel/printk/printk.c:225
console_trylock+0x15/0xa0 kernel/printk/printk.c:2230
console_trylock_spinning kernel/printk/printk.c:1643 [inline]
vprintk_emit+0x699/0xde0 kernel/printk/printk.c:1906
vprintk_default+0x28/0x30 kernel/printk/printk.c:1948
vprintk_func+0x7a/0xe7 kernel/printk/printk_safe.c:382
printk+0x9e/0xba kernel/printk/printk.c:1981
__warn.cold.8+0x73/0x1b3 kernel/panic.c:518
report_bug+0x252/0x2d0 lib/bug.c:186
fixup_bug arch/x86/kernel/traps.c:178 [inline]
do_error_trap+0x1fc/0x4d0 arch/x86/kernel/traps.c:296
do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316
invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:992
RIP: 0010:event_function_local.constprop.115+0x520/0x5c0 kernel/events/core.c:331
Code: 00 48 8b 95 70 ff ff ff e9 b8 fc ff ff 48 89 85 70 ff ff ff e8 71 b5 25 00 48 8b 85 70 ff ff ff e9 f6 fc ff ff e8 80 8b e8 ff <0f> 0b e9 6d fe ff ff 48 8b bd 68 ff ff ff e8 6d b5 25 00 48 8d 55
RSP: 0018:ffff8801daf07cf8 EFLAGS: 00010006
RAX: ffff880199bb4500 RBX: ffff8801c4ea3080 RCX: ffffffff8191b01a
RDX: 0000000000010000 RSI: ffffffff8191b210 RDI: 0000000000000005
RBP: ffff8801daf07d98 R08: ffff880199bb4500 R09: ffffed00389d4611
R10: ffffed00389d4611 R11: ffff8801c4ea308b R12: 1ffff1003b5e0fa2
R13: ffff8801daf31a00 R14: ffff8801c9bcc2c0 R15: ffff8801af664d00
perf_event_disable_local kernel/events/core.c:2180 [inline]
perf_pending_event+0x242/0x2a0 kernel/events/core.c:5811
irq_work_run_list+0x1b4/0x270 kernel/irq_work.c:155
irq_work_run+0x1d/0x50 kernel/irq_work.c:170
smp_irq_work_interrupt+0x10a/0x650 arch/x86/kernel/irq_work.c:21
irq_work_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894
RIP: 0010:arch_local_irq_enable arch/x86/include/asm/paravirt.h:793 [inline]
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x56/0x70 kernel/locking/spinlock.c:192
Code: f1 88 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 75 1d 48 83 3d 3b dc 6e 01 00 74 11 fb 66 0f 1f 44 00 00 <65> ff 0d 83 21 7f 78 5b 5d c3 0f 0b e8 39 9b 34 fa eb dc 0f 1f 80
RSP: 0018:ffff88019630fd50 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff09
RAX: dffffc0000000000 RBX: ffff8801a9dffc08 RCX: 0000000000000000
RDX: 1ffffffff11e350f RSI: 0000000000000001 RDI: ffffffff88f1a878
RBP: ffff88019630fd58 R08: ffffed00353bff82 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff8801a9dffc08
R13: ffff8801c65d7740 R14: ffff8801c65d77d0 R15: ffff8801c65d77dc
spin_unlock_irq include/linux/spinlock.h:360 [inline]
do_group_exit+0x357/0x430 kernel/exit.c:965
__x64_sys_exit_group+0x
Lost 80 message(s)!
Shutting down cpus with NMI
Dumping ftrace buffer:
(ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..