====================================================== WARNING: possible circular locking dependency detected 6.13.0-rc7-syzkaller-00149-g9bffa1ad25b8 #0 Not tainted ------------------------------------------------------ syz.0.116/6551 is trying to acquire lock: ffffe8ffac438ff0 (&per_cpu_ptr(pool->acomp_ctx, cpu)->mutex){+.+.}-{4:4}, at: acomp_ctx_get_cpu_lock mm/zswap.c:899 [inline] ffffe8ffac438ff0 (&per_cpu_ptr(pool->acomp_ctx, cpu)->mutex){+.+.}-{4:4}, at: zswap_compress mm/zswap.c:931 [inline] ffffe8ffac438ff0 (&per_cpu_ptr(pool->acomp_ctx, cpu)->mutex){+.+.}-{4:4}, at: zswap_store_page mm/zswap.c:1456 [inline] ffffe8ffac438ff0 (&per_cpu_ptr(pool->acomp_ctx, cpu)->mutex){+.+.}-{4:4}, at: zswap_store+0x910/0x2600 mm/zswap.c:1563 but task is already holding lock: ffffffff8df4f160 (fs_reclaim){+.+.}-{0:0}, at: __perform_reclaim mm/page_alloc.c:3926 [inline] ffffffff8df4f160 (fs_reclaim){+.+.}-{0:0}, at: __alloc_pages_direct_reclaim mm/page_alloc.c:3951 [inline] ffffffff8df4f160 (fs_reclaim){+.+.}-{0:0}, at: __alloc_pages_slowpath mm/page_alloc.c:4382 [inline] ffffffff8df4f160 (fs_reclaim){+.+.}-{0:0}, at: __alloc_pages_noprof+0xa8b/0x25b0 mm/page_alloc.c:4766 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (fs_reclaim){+.+.}-{0:0}: __fs_reclaim_acquire mm/page_alloc.c:3853 [inline] fs_reclaim_acquire+0x102/0x150 mm/page_alloc.c:3867 might_alloc include/linux/sched/mm.h:318 [inline] slab_pre_alloc_hook mm/slub.c:4070 [inline] slab_alloc_node mm/slub.c:4148 [inline] __kmalloc_cache_node_noprof+0x55/0x3f0 mm/slub.c:4337 kmalloc_node_noprof include/linux/slab.h:924 [inline] zswap_cpu_comp_prepare+0xc9/0x470 mm/zswap.c:828 cpuhp_invoke_callback+0x20c/0xa10 kernel/cpu.c:204 cpuhp_issue_call+0x1c0/0x980 kernel/cpu.c:2375 __cpuhp_state_add_instance_cpuslocked+0x1a4/0x3c0 kernel/cpu.c:2437 __cpuhp_state_add_instance+0xd7/0x2e0 kernel/cpu.c:2458 cpuhp_state_add_instance include/linux/cpuhotplug.h:386 [inline] zswap_pool_create+0x41c/0x710 mm/zswap.c:291 __zswap_pool_create_fallback mm/zswap.c:359 [inline] zswap_setup+0x402/0x810 mm/zswap.c:1811 zswap_init+0x2c/0x40 mm/zswap.c:1847 do_one_initcall+0x128/0x630 init/main.c:1266 do_initcall_level init/main.c:1328 [inline] do_initcalls init/main.c:1344 [inline] do_basic_setup init/main.c:1363 [inline] kernel_init_freeable+0x58f/0x8b0 init/main.c:1577 kernel_init+0x1c/0x2b0 init/main.c:1466 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #0 (&per_cpu_ptr(pool->acomp_ctx, cpu)->mutex){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5226 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 acomp_ctx_get_cpu_lock mm/zswap.c:899 [inline] zswap_compress mm/zswap.c:931 [inline] zswap_store_page mm/zswap.c:1456 [inline] zswap_store+0x910/0x2600 mm/zswap.c:1563 swap_writepage+0x3b6/0x1120 mm/page_io.c:279 pageout+0x3b2/0xaa0 mm/vmscan.c:696 shrink_folio_list+0x3025/0x42d0 mm/vmscan.c:1374 evict_folios+0x6e7/0x1a50 mm/vmscan.c:4600 try_to_shrink_lruvec+0x61e/0xa80 mm/vmscan.c:4799 shrink_one+0x3e3/0x7b0 mm/vmscan.c:4844 shrink_many mm/vmscan.c:4907 [inline] lru_gen_shrink_node mm/vmscan.c:4985 [inline] shrink_node+0xbf0/0x3f20 mm/vmscan.c:5966 shrink_zones mm/vmscan.c:6225 [inline] do_try_to_free_pages+0x35f/0x1a30 mm/vmscan.c:6287 try_to_free_pages+0x2ae/0x6b0 mm/vmscan.c:6537 __perform_reclaim mm/page_alloc.c:3929 [inline] __alloc_pages_direct_reclaim mm/page_alloc.c:3951 [inline] __alloc_pages_slowpath mm/page_alloc.c:4382 [inline] __alloc_pages_noprof+0xb0c/0x25b0 mm/page_alloc.c:4766 __folio_alloc_noprof+0x11/0x90 mm/page_alloc.c:4785 alloc_charge_folio+0x2bd/0x980 mm/khugepaged.c:1080 collapse_huge_page+0x1b2/0x30b0 mm/khugepaged.c:1124 hpage_collapse_scan_pmd+0x53b/0x1210 mm/khugepaged.c:1430 madvise_collapse+0x805/0xac0 mm/khugepaged.c:2781 madvise_vma_behavior+0xbb0/0x1da0 mm/madvise.c:1316 madvise_walk_vmas+0x1cf/0x2c0 mm/madvise.c:1497 do_madvise+0x30e/0x770 mm/madvise.c:1684 __do_sys_madvise mm/madvise.c:1700 [inline] __se_sys_madvise mm/madvise.c:1698 [inline] __ia32_sys_madvise+0xa7/0x110 mm/madvise.c:1698 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(fs_reclaim); lock(&per_cpu_ptr(pool->acomp_ctx, cpu)->mutex); lock(fs_reclaim); lock(&per_cpu_ptr(pool->acomp_ctx, cpu)->mutex); *** DEADLOCK *** 1 lock held by syz.0.116/6551: #0: ffffffff8df4f160 (fs_reclaim){+.+.}-{0:0}, at: __perform_reclaim mm/page_alloc.c:3926 [inline] #0: ffffffff8df4f160 (fs_reclaim){+.+.}-{0:0}, at: __alloc_pages_direct_reclaim mm/page_alloc.c:3951 [inline] #0: ffffffff8df4f160 (fs_reclaim){+.+.}-{0:0}, at: __alloc_pages_slowpath mm/page_alloc.c:4382 [inline] #0: ffffffff8df4f160 (fs_reclaim){+.+.}-{0:0}, at: __alloc_pages_noprof+0xa8b/0x25b0 mm/page_alloc.c:4766 stack backtrace: CPU: 2 UID: 0 PID: 6551 Comm: syz.0.116 Not tainted 6.13.0-rc7-syzkaller-00149-g9bffa1ad25b8 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x41c/0x610 kernel/locking/lockdep.c:2074 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5226 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 acomp_ctx_get_cpu_lock mm/zswap.c:899 [inline] zswap_compress mm/zswap.c:931 [inline] zswap_store_page mm/zswap.c:1456 [inline] zswap_store+0x910/0x2600 mm/zswap.c:1563 swap_writepage+0x3b6/0x1120 mm/page_io.c:279 pageout+0x3b2/0xaa0 mm/vmscan.c:696 shrink_folio_list+0x3025/0x42d0 mm/vmscan.c:1374 evict_folios+0x6e7/0x1a50 mm/vmscan.c:4600 try_to_shrink_lruvec+0x61e/0xa80 mm/vmscan.c:4799 shrink_one+0x3e3/0x7b0 mm/vmscan.c:4844 shrink_many mm/vmscan.c:4907 [inline] lru_gen_shrink_node mm/vmscan.c:4985 [inline] shrink_node+0xbf0/0x3f20 mm/vmscan.c:5966 shrink_zones mm/vmscan.c:6225 [inline] do_try_to_free_pages+0x35f/0x1a30 mm/vmscan.c:6287 try_to_free_pages+0x2ae/0x6b0 mm/vmscan.c:6537 __perform_reclaim mm/page_alloc.c:3929 [inline] __alloc_pages_direct_reclaim mm/page_alloc.c:3951 [inline] __alloc_pages_slowpath mm/page_alloc.c:4382 [inline] __alloc_pages_noprof+0xb0c/0x25b0 mm/page_alloc.c:4766 __folio_alloc_noprof+0x11/0x90 mm/page_alloc.c:4785 alloc_charge_folio+0x2bd/0x980 mm/khugepaged.c:1080 collapse_huge_page+0x1b2/0x30b0 mm/khugepaged.c:1124 hpage_collapse_scan_pmd+0x53b/0x1210 mm/khugepaged.c:1430 madvise_collapse+0x805/0xac0 mm/khugepaged.c:2781 madvise_vma_behavior+0xbb0/0x1da0 mm/madvise.c:1316 madvise_walk_vmas+0x1cf/0x2c0 mm/madvise.c:1497 do_madvise+0x30e/0x770 mm/madvise.c:1684 __do_sys_madvise mm/madvise.c:1700 [inline] __se_sys_madvise mm/madvise.c:1698 [inline] __ia32_sys_madvise+0xa7/0x110 mm/madvise.c:1698 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7ff0579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f512555c EFLAGS: 00000296 ORIG_RAX: 00000000000000db RAX: ffffffffffffffda RBX: 0000000020000000 RCX: 0000000000600707 RDX: 0000000000000019 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 syz.0.116 (6551) used greatest stack depth: 20920 bytes left ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi