* [syzbot] [fuse?] BUG: scheduling while atomic in __synchronize_srcu
@ 2026-04-09 18:30 syzbot
2026-04-11 5:14 ` Forwarded: [PATCH] arm64: KVM: Initialize vGIC before preempt-disabled section in kvm_reset_vcpu() syzbot
0 siblings, 1 reply; 2+ messages in thread
From: syzbot @ 2026-04-09 18:30 UTC (permalink / raw)
To: anna-maria, frederic, linux-fsdevel, linux-kernel, miklos,
syzkaller-bugs, tglx
Hello,
syzbot found the following issue on:
HEAD commit: 7f87a5ea75f0 Merge tag 'hid-for-linus-2026040801' of git:/..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12439316580000
kernel config: https://syzkaller.appspot.com/x/.config?x=2d08886358f27e8c
dashboard link: https://syzkaller.appspot.com/bug?extid=12b178b7c756664d2518
compiler: aarch64-linux-gnu-gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1461aeba580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14c85e06580000
Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/fa3fbcfdac58/non_bootable_disk-7f87a5ea.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/28f02ff1720d/vmlinux-7f87a5ea.xz
kernel image: https://storage.googleapis.com/syzbot-assets/7d30b9e8505e/Image-7f87a5ea.gz.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+12b178b7c756664d2518@syzkaller.appspotmail.com
BUG: scheduling while atomic: syz.1.49/3699/0x00000002
Modules linked in:
CPU: 1 UID: 0 PID: 3699 Comm: syz.1.49 Not tainted syzkaller #0 PREEMPT
Hardware name: linux,dummy-virt (DT)
Call trace:
dump_backtrace arch/arm64/kernel/stacktrace.c:498 [inline] (C)
show_stack+0x18/0x24 arch/arm64/kernel/stacktrace.c:499 (C)
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x60/0x80 lib/dump_stack.c:120
dump_stack+0x18/0x24 lib/dump_stack.c:129
__schedule_bug+0x54/0x78 kernel/sched/core.c:5847
schedule_debug kernel/sched/core.c:5874 [inline]
__schedule+0x858/0xd84 kernel/sched/core.c:6786
__schedule_loop kernel/sched/core.c:6993 [inline]
schedule+0x34/0x114 kernel/sched/core.c:7008
schedule_timeout+0xd4/0x110 kernel/time/sleep_timeout.c:75
do_wait_for_common kernel/sched/completion.c:100 [inline]
__wait_for_common kernel/sched/completion.c:121 [inline]
wait_for_common kernel/sched/completion.c:132 [inline]
wait_for_completion+0x78/0x160 kernel/sched/completion.c:153
__synchronize_srcu+0x90/0xd0 kernel/rcu/srcutree.c:1496
synchronize_srcu_expedited+0x24/0x40 kernel/rcu/srcutree.c:1521
kvm_set_irq_routing+0x204/0x294 virt/kvm/irqchip.c:225
kvm_vgic_setup_default_irq_routing+0x78/0xc0 arch/arm64/kvm/vgic/vgic-irqfd.c:153
vgic_init+0x1ac/0x268 arch/arm64/kvm/vgic/vgic-init.c:421
vgic_lazy_init+0x54/0x6c arch/arm64/kvm/vgic/vgic-init.c:550
kvm_vgic_inject_irq+0x30/0x12c arch/arm64/kvm/vgic/vgic.c:520
kvm_timer_update_irq+0x68/0x7c arch/arm64/kvm/arch_timer.c:450
kvm_timer_vcpu_reset+0xd8/0x1e0 arch/arm64/kvm/arch_timer.c:1036
kvm_reset_vcpu+0x194/0x360 arch/arm64/kvm/reset.c:268
kvm_vcpu_set_target arch/arm64/kvm/arm.c:1632 [inline]
kvm_arch_vcpu_ioctl_vcpu_init arch/arm64/kvm/arm.c:1652 [inline]
kvm_arch_vcpu_ioctl+0x2e4/0x8c8 arch/arm64/kvm/arm.c:1773
kvm_vcpu_ioctl+0x4ac/0x8f4 virt/kvm/kvm_main.c:4653
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__arm64_sys_ioctl+0xac/0x104 fs/ioctl.c:583
__invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
invoke_syscall+0x48/0x104 arch/arm64/kernel/syscall.c:49
el0_svc_common.constprop.0+0x40/0xe0 arch/arm64/kernel/syscall.c:132
do_el0_svc+0x1c/0x28 arch/arm64/kernel/syscall.c:151
el0_svc+0x34/0x124 arch/arm64/kernel/entry-common.c:724
el0t_64_sync_handler+0xa0/0xf0 arch/arm64/kernel/entry-common.c:743
el0t_64_sync+0x1a4/0x1a8 arch/arm64/kernel/entry.S:596
BUG: scheduling while atomic: syz.1.49/3699/0x00000000
Modules linked in:
CPU: 1 UID: 0 PID: 3699 Comm: syz.1.49 Tainted: G W syzkaller #0 PREEMPT
Tainted: [W]=WARN
Hardware name: linux,dummy-virt (DT)
Call trace:
dump_backtrace arch/arm64/kernel/stacktrace.c:498 [inline] (C)
show_stack+0x18/0x24 arch/arm64/kernel/stacktrace.c:499 (C)
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0x60/0x80 lib/dump_stack.c:120
dump_stack+0x18/0x24 lib/dump_stack.c:129
__schedule_bug+0x54/0x78 kernel/sched/core.c:5847
schedule_debug kernel/sched/core.c:5874 [inline]
__schedule+0x858/0xd84 kernel/sched/core.c:6786
__schedule_loop kernel/sched/core.c:6993 [inline]
schedule+0x34/0x114 kernel/sched/core.c:7008
futex_do_wait kernel/futex/waitwake.c:358 [inline]
__futex_wait+0xf0/0x178 kernel/futex/waitwake.c:687
futex_wait+0x88/0x118 kernel/futex/waitwake.c:715
do_futex+0xf8/0x1a0 kernel/futex/syscalls.c:130
__do_sys_futex kernel/futex/syscalls.c:207 [inline]
__se_sys_futex kernel/futex/syscalls.c:188 [inline]
__arm64_sys_futex+0xfc/0x1a0 kernel/futex/syscalls.c:188
__invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
invoke_syscall+0x48/0x104 arch/arm64/kernel/syscall.c:49
el0_svc_common.constprop.0+0x40/0xe0 arch/arm64/kernel/syscall.c:132
do_el0_svc+0x1c/0x28 arch/arm64/kernel/syscall.c:151
el0_svc+0x34/0x124 arch/arm64/kernel/entry-common.c:724
el0t_64_sync_handler+0xa0/0xf0 arch/arm64/kernel/entry-common.c:743
el0t_64_sync+0x1a4/0x1a8 arch/arm64/kernel/entry.S:596
psi: inconsistent task state! task=30:pr/ttyAMA-1 cpu=1 psi_flags=14 clear=0 set=10
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 2+ messages in thread
* Forwarded: [PATCH] arm64: KVM: Initialize vGIC before preempt-disabled section in kvm_reset_vcpu()
2026-04-09 18:30 [syzbot] [fuse?] BUG: scheduling while atomic in __synchronize_srcu syzbot
@ 2026-04-11 5:14 ` syzbot
0 siblings, 0 replies; 2+ messages in thread
From: syzbot @ 2026-04-11 5:14 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: [PATCH] arm64: KVM: Initialize vGIC before preempt-disabled section in kvm_reset_vcpu()
Author: kartikey406@gmail.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
kvm_reset_vcpu() calls kvm_timer_vcpu_reset() inside a preempt-disabled
section to avoid races with preempt notifiers that also call vcpu put/load.
However, kvm_timer_vcpu_reset() eventually calls kvm_vgic_inject_irq()
which triggers vgic_lazy_init() if the vGIC has not been initialized yet.
vgic_lazy_init() acquires a mutex and calls vgic_init() which invokes
synchronize_srcu_expedited() -- both of which may sleep. Sleeping inside
a preempt-disabled section is illegal and causes:
BUG: scheduling while atomic: syz.1.49/3699/0x00000002
Fix this by calling vgic_lazy_init() before preempt_disable(). On the
second call inside kvm_vgic_inject_irq(), vgic_initialized() will return
true and vgic_lazy_init() will return immediately without sleeping.
Reported-by: syzbot+12b178b7c756664d2518@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=12b178b7c756664d2518
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
---
arch/arm64/kvm/reset.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c
index b963fd975aac..4ee16b4a37b5 100644
--- a/arch/arm64/kvm/reset.c
+++ b/arch/arm64/kvm/reset.c
@@ -25,6 +25,7 @@
#include <asm/ptrace.h>
#include <asm/kvm_arm.h>
#include <asm/kvm_asm.h>
+#include "vgic/vgic.h"
#include <asm/kvm_emulate.h>
#include <asm/kvm_mmu.h>
#include <asm/kvm_nested.h>
@@ -198,6 +199,14 @@ void kvm_reset_vcpu(struct kvm_vcpu *vcpu)
vcpu->arch.reset_state.reset = false;
spin_unlock(&vcpu->arch.mp_state_lock);
+
+ /*
+ * Initialize vGIC before entering preempt-disabled section.
+ * vgic_lazy_init() may sleep via mutex_lock, which is illegal
+ * inside preempt_disable(). Second call inside kvm_vgic_inject_irq
+ * will find vGIC already initialized and return immediately.
+ */
+ vgic_lazy_init(vcpu->kvm);
preempt_disable();
loaded = (vcpu->cpu != -1);
if (loaded)
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-11 5:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-09 18:30 [syzbot] [fuse?] BUG: scheduling while atomic in __synchronize_srcu syzbot
2026-04-11 5:14 ` Forwarded: [PATCH] arm64: KVM: Initialize vGIC before preempt-disabled section in kvm_reset_vcpu() syzbot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox