Hello,
syzbot found the following issue on:
HEAD commit: 674f684f7c61 Linux 5.15.212
git tree: linux-5.15.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=143da499580000
kernel config:
https://syzkaller.appspot.com/x/.config?x=f161cbc9aef65db0
dashboard link:
https://syzkaller.appspot.com/bug?extid=72ecb22c0ef68b3074f8
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/f55be2937b89/disk-674f684f.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/a19fb0ffc049/vmlinux-674f684f.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/365d4529a007/bzImage-674f684f.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+72ecb2...@syzkaller.appspotmail.com
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
kswapd0/254 is trying to acquire lock:
ffffffff8c10ffc8 (kvm_lock){+.+.}-{3:3}, at: mmu_shrink_scan+0xa8/0x820 arch/x86/kvm/mmu/mmu.c:5998
but task is already holding lock:
ffffffff8c3ded00 (fs_reclaim){+.+.}-{0:0}, at: 0x1
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (fs_reclaim){+.+.}-{0:0}:
__fs_reclaim_acquire mm/page_alloc.c:4580 [inline]
fs_reclaim_acquire+0x6d/0x100 mm/page_alloc.c:4594
might_alloc include/linux/sched/mm.h:206 [inline]
slab_pre_alloc_hook+0x20/0xc0 mm/slab.h:492
slab_alloc_node mm/slub.c:3139 [inline]
kmem_cache_alloc_node_trace+0x4a/0x2f0 mm/slub.c:3275
kmalloc_node include/linux/slab.h:625 [inline]
kzalloc_node include/linux/slab.h:749 [inline]
__get_vm_area_node+0x119/0x2d0 mm/vmalloc.c:2423
__vmalloc_node_range+0xef/0x8b0 mm/vmalloc.c:3027
__vmalloc_node mm/vmalloc.c:3087 [inline]
__vmalloc+0x76/0x80 mm/vmalloc.c:3101
kvm_alloc_dirty_bitmap virt/kvm/kvm_main.c:1318 [inline]
__kvm_set_memory_region+0xc05/0xd90 virt/kvm/kvm_main.c:1835
kvm_set_memory_region virt/kvm/kvm_main.c:1864 [inline]
kvm_vm_ioctl_set_memory_region+0x6f/0xa0 virt/kvm/kvm_main.c:1876
kvm_vm_ioctl+0x8d7/0xb00 virt/kvm/kvm_main.c:4493
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
-> #1 (&kvm->slots_lock){+.+.}-{3:3}:
__mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
set_nx_huge_pages+0x16f/0x2f0 arch/x86/kvm/mmu/mmu.c:6102
param_attr_store+0x20a/0x300 kernel/params.c:585
module_attr_store+0x5b/0x80 kernel/params.c:905
kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x748/0xd70 fs/read_write.c:594
ksys_write+0x153/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
-> #0 (kvm_lock){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
mmu_shrink_scan+0xa8/0x820 arch/x86/kvm/mmu/mmu.c:5998
do_shrink_slab+0x51f/0xd40 mm/vmscan.c:765
shrink_slab+0x1c5/0x7a0 mm/vmscan.c:925
shrink_node_memcgs mm/vmscan.c:2958 [inline]
shrink_node+0x11f5/0x2790 mm/vmscan.c:3079
kswapd_shrink_node mm/vmscan.c:3821 [inline]
balance_pgdat+0xdf3/0x1a10 mm/vmscan.c:4012
kswapd+0x7db/0xde0 mm/vmscan.c:4271
kthread+0x42e/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
other info that might help us debug this:
Chain exists of:
kvm_lock --> &kvm->slots_lock --> fs_reclaim
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(fs_reclaim);
lock(&kvm->slots_lock);
lock(fs_reclaim);
lock(kvm_lock);
*** DEADLOCK ***
2 locks held by kswapd0/254:
#0: ffffffff8c3ded00 (fs_reclaim){+.+.}-{0:0}, at: 0x1
#1: ffffffff8c3bc310 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab+0x11c/0x7a0 mm/vmscan.c:915
stack backtrace:
CPU: 0 PID: 254 Comm: kswapd0 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
check_noncircular+0x296/0x330 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 kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
mmu_shrink_scan+0xa8/0x820 arch/x86/kvm/mmu/mmu.c:5998
do_shrink_slab+0x51f/0xd40 mm/vmscan.c:765
shrink_slab+0x1c5/0x7a0 mm/vmscan.c:925
shrink_node_memcgs mm/vmscan.c:2958 [inline]
shrink_node+0x11f5/0x2790 mm/vmscan.c:3079
kswapd_shrink_node mm/vmscan.c:3821 [inline]
balance_pgdat+0xdf3/0x1a10 mm/vmscan.c:4012
kswapd+0x7db/0xde0 mm/vmscan.c:4271
kthread+0x42e/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
</TASK>
---
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
syzk...@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 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