====================================================== WARNING: possible circular locking dependency detected 5.14.0-rc1-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/20952 is trying to acquire lock: ffffffff8ba9c3a0 (fs_reclaim){+.+.}-{0:0}, at: fs_reclaim_acquire+0xf7/0x160 mm/page_alloc.c:4574 but task is already holding lock: ffff8880b9c4d660 (lock#2){-.-.}-{2:2}, at: __alloc_pages_bulk+0x4ad/0x1870 mm/page_alloc.c:5279 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (lock#2){-.-.}-{2:2}: local_lock_acquire include/linux/local_lock_internal.h:42 [inline] rmqueue_pcplist mm/page_alloc.c:3663 [inline] rmqueue mm/page_alloc.c:3701 [inline] get_page_from_freelist+0x4aa/0x2f80 mm/page_alloc.c:4163 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5374 alloc_page_interleave+0x1e/0x200 mm/mempolicy.c:2119 alloc_pages+0x238/0x2a0 mm/mempolicy.c:2242 stack_depot_save+0x39d/0x4e0 lib/stackdepot.c:303 kasan_save_stack+0x32/0x40 mm/kasan/common.c:40 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:348 insert_work+0x48/0x370 kernel/workqueue.c:1332 __queue_work+0x5c1/0xed0 kernel/workqueue.c:1498 queue_work_on+0xee/0x110 kernel/workqueue.c:1525 queue_work include/linux/workqueue.h:507 [inline] schedule_work include/linux/workqueue.h:568 [inline] rfkill_register+0x678/0xb00 net/rfkill/core.c:1077 nfc_register_device+0x132/0x360 net/nfc/core.c:1136 nfcsim_device_new+0x345/0x5c1 drivers/nfc/nfcsim.c:408 nfcsim_init+0x71/0x14d drivers/nfc/nfcsim.c:455 do_one_initcall+0x103/0x650 init/main.c:1282 do_initcall_level init/main.c:1355 [inline] do_initcalls init/main.c:1371 [inline] do_basic_setup init/main.c:1391 [inline] kernel_init_freeable+0x6b8/0x741 init/main.c:1593 kernel_init+0x1a/0x1d0 init/main.c:1485 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 -> #1 (&pool->lock){-.-.}-{2:2}: __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151 __queue_work+0x366/0xed0 kernel/workqueue.c:1455 queue_work_on+0xee/0x110 kernel/workqueue.c:1525 queue_work include/linux/workqueue.h:507 [inline] schedule_work include/linux/workqueue.h:568 [inline] __vfree_deferred mm/vmalloc.c:2609 [inline] vfree_atomic+0xac/0xe0 mm/vmalloc.c:2627 free_thread_stack kernel/fork.c:292 [inline] release_task_stack kernel/fork.c:432 [inline] put_task_stack+0x2e0/0x4e0 kernel/fork.c:443 finish_task_switch.isra.0+0x77f/0xa50 kernel/sched/core.c:4595 context_switch kernel/sched/core.c:4686 [inline] __schedule+0x942/0x26f0 kernel/sched/core.c:5940 preempt_schedule_irq+0x4e/0x90 kernel/sched/core.c:6328 irqentry_exit+0x31/0x80 kernel/entry/common.c:427 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 __need_reclaim mm/page_alloc.c:4544 [inline] __need_reclaim mm/page_alloc.c:4534 [inline] fs_reclaim_release+0x88/0xf0 mm/page_alloc.c:4581 might_alloc include/linux/sched/mm.h:199 [inline] slab_pre_alloc_hook mm/slab.h:485 [inline] slab_alloc_node mm/slub.c:2902 [inline] slab_alloc mm/slub.c:2989 [inline] kmem_cache_alloc+0x46/0x3a0 mm/slub.c:2994 kmem_cache_zalloc include/linux/slab.h:711 [inline] __kernfs_new_node+0xd4/0x8b0 fs/kernfs/dir.c:583 kernfs_new_node+0x93/0x120 fs/kernfs/dir.c:645 __kernfs_create_file+0x51/0x350 fs/kernfs/file.c:985 sysfs_add_file_mode_ns+0x226/0x540 fs/sysfs/file.c:317 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x328/0xb20 fs/sysfs/group.c:149 kernel_add_sysfs_param kernel/params.c:796 [inline] param_sysfs_builtin kernel/params.c:833 [inline] param_sysfs_init+0x39a/0x498 kernel/params.c:952 do_one_initcall+0x103/0x650 init/main.c:1282 do_initcall_level init/main.c:1355 [inline] do_initcalls init/main.c:1371 [inline] do_basic_setup init/main.c:1391 [inline] kernel_init_freeable+0x6b8/0x741 init/main.c:1593 kernel_init+0x1a/0x1d0 init/main.c:1485 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 -> #0 (fs_reclaim){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3051 [inline] check_prevs_add kernel/locking/lockdep.c:3174 [inline] validate_chain kernel/locking/lockdep.c:3789 [inline] __lock_acquire+0x2a07/0x54a0 kernel/locking/lockdep.c:5015 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 __fs_reclaim_acquire mm/page_alloc.c:4552 [inline] fs_reclaim_acquire+0x117/0x160 mm/page_alloc.c:4566 prepare_alloc_pages+0x15c/0x580 mm/page_alloc.c:5164 __alloc_pages+0x12f/0x500 mm/page_alloc.c:5363 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244 stack_depot_save+0x39d/0x4e0 lib/stackdepot.c:303 save_stack+0x15e/0x1e0 mm/page_owner.c:120 __set_page_owner+0x50/0x290 mm/page_owner.c:181 prep_new_page mm/page_alloc.c:2433 [inline] __alloc_pages_bulk+0x8b9/0x1870 mm/page_alloc.c:5301 alloc_pages_bulk_array_node include/linux/gfp.h:557 [inline] vm_area_alloc_pages mm/vmalloc.c:2793 [inline] __vmalloc_area_node mm/vmalloc.c:2863 [inline] __vmalloc_node_range+0x39d/0x960 mm/vmalloc.c:2966 __vmalloc_node mm/vmalloc.c:3015 [inline] vzalloc+0x67/0x80 mm/vmalloc.c:3085 deflate_comp_init+0x2e/0x140 crypto/deflate.c:47 __deflate_init crypto/deflate.c:112 [inline] deflate_init+0x20/0x150 crypto/deflate.c:154 __crypto_alloc_tfm+0x2a3/0x450 crypto/api.c:362 crypto_alloc_base+0x76/0x190 crypto/api.c:416 crypto_alloc_comp include/linux/crypto.h:731 [inline] ipcomp_alloc_tfms net/xfrm/xfrm_ipcomp.c:294 [inline] ipcomp_init_state+0x710/0xa40 net/xfrm/xfrm_ipcomp.c:350 ipcomp4_init_state+0xc2/0x8e0 net/ipv4/ipcomp.c:135 __xfrm_init_state+0x995/0x15c0 net/xfrm/xfrm_state.c:2648 xfrm_init_state+0x1a/0x70 net/xfrm/xfrm_state.c:2675 pfkey_msg2xfrm_state net/key/af_key.c:1287 [inline] pfkey_add+0x1a64/0x2cd0 net/key/af_key.c:1504 pfkey_process+0x685/0x7e0 net/key/af_key.c:2837 pfkey_sendmsg+0x43a/0x820 net/key/af_key.c:3676 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:723 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2392 ___sys_sendmsg+0xf3/0x170 net/socket.c:2446 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2475 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae other info that might help us debug this: Chain exists of: fs_reclaim --> &pool->lock --> lock#2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(lock#2); lock(&pool->lock); lock(lock#2); lock(fs_reclaim); *** DEADLOCK *** 3 locks held by syz-executor.1/20952: #0: ffff88802d9ab1a0 (&net->xfrm.xfrm_cfg_mutex){+.+.}-{3:3}, at: pfkey_sendmsg+0x42c/0x820 net/key/af_key.c:3675 #1: ffffffff8d261c88 (ipcomp_resource_mutex){+.+.}-{3:3}, at: ipcomp_init_state+0xda/0xa40 net/xfrm/xfrm_ipcomp.c:346 #2: ffff8880b9c4d660 (lock#2){-.-.}-{2:2}, at: __alloc_pages_bulk+0x4ad/0x1870 mm/page_alloc.c:5279 stack backtrace: CPU: 0 PID: 20952 Comm: syz-executor.1 Not tainted 5.14.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2131 check_prev_add kernel/locking/lockdep.c:3051 [inline] check_prevs_add kernel/locking/lockdep.c:3174 [inline] validate_chain kernel/locking/lockdep.c:3789 [inline] __lock_acquire+0x2a07/0x54a0 kernel/locking/lockdep.c:5015 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 __fs_reclaim_acquire mm/page_alloc.c:4552 [inline] fs_reclaim_acquire+0x117/0x160 mm/page_alloc.c:4566 prepare_alloc_pages+0x15c/0x580 mm/page_alloc.c:5164 __alloc_pages+0x12f/0x500 mm/page_alloc.c:5363 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244 stack_depot_save+0x39d/0x4e0 lib/stackdepot.c:303 save_stack+0x15e/0x1e0 mm/page_owner.c:120 __set_page_owner+0x50/0x290 mm/page_owner.c:181 prep_new_page mm/page_alloc.c:2433 [inline] __alloc_pages_bulk+0x8b9/0x1870 mm/page_alloc.c:5301 alloc_pages_bulk_array_node include/linux/gfp.h:557 [inline] vm_area_alloc_pages mm/vmalloc.c:2793 [inline] __vmalloc_area_node mm/vmalloc.c:2863 [inline] __vmalloc_node_range+0x39d/0x960 mm/vmalloc.c:2966 __vmalloc_node mm/vmalloc.c:3015 [inline] vzalloc+0x67/0x80 mm/vmalloc.c:3085 deflate_comp_init+0x2e/0x140 crypto/deflate.c:47 __deflate_init crypto/deflate.c:112 [inline] deflate_init+0x20/0x150 crypto/deflate.c:154 __crypto_alloc_tfm+0x2a3/0x450 crypto/api.c:362 crypto_alloc_base+0x76/0x190 crypto/api.c:416 crypto_alloc_comp include/linux/crypto.h:731 [inline] ipcomp_alloc_tfms net/xfrm/xfrm_ipcomp.c:294 [inline] ipcomp_init_state+0x710/0xa40 net/xfrm/xfrm_ipcomp.c:350 ipcomp4_init_state+0xc2/0x8e0 net/ipv4/ipcomp.c:135 __xfrm_init_state+0x995/0x15c0 net/xfrm/xfrm_state.c:2648 xfrm_init_state+0x1a/0x70 net/xfrm/xfrm_state.c:2675 pfkey_msg2xfrm_state net/key/af_key.c:1287 [inline] pfkey_add+0x1a64/0x2cd0 net/key/af_key.c:1504 pfkey_process+0x685/0x7e0 net/key/af_key.c:2837 pfkey_sendmsg+0x43a/0x820 net/key/af_key.c:3676 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:723 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2392 ___sys_sendmsg+0xf3/0x170 net/socket.c:2446 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2475 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4665e9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3645f37188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665e9 RDX: 0000000000000000 RSI: 0000000020f56000 RDI: 0000000000000005 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffd2f41ea3f R14: 00007f3645f37300 R15: 0000000000022000 BUG: sleeping function called from invalid context at mm/page_alloc.c:5167 in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 20952, name: syz-executor.1 INFO: lockdep is turned off. irq event stamp: 426 hardirqs last enabled at (425): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (425): [] _raw_spin_unlock_irqrestore+0x50/0x70 kernel/locking/spinlock.c:191 hardirqs last disabled at (426): [] __alloc_pages_bulk+0x1017/0x1870 mm/page_alloc.c:5279 softirqs last enabled at (318): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last enabled at (318): [] __irq_exit_rcu+0x16e/0x1c0 kernel/softirq.c:636 softirqs last disabled at (195): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last disabled at (195): [] __irq_exit_rcu+0x16e/0x1c0 kernel/softirq.c:636 CPU: 0 PID: 20952 Comm: syz-executor.1 Not tainted 5.14.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 ___might_sleep.cold+0x1f1/0x237 kernel/sched/core.c:9154 prepare_alloc_pages+0x3da/0x580 mm/page_alloc.c:5167 __alloc_pages+0x12f/0x500 mm/page_alloc.c:5363 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244 stack_depot_save+0x39d/0x4e0 lib/stackdepot.c:303 save_stack+0x15e/0x1e0 mm/page_owner.c:120 __set_page_owner+0x50/0x290 mm/page_owner.c:181 prep_new_page mm/page_alloc.c:2433 [inline] __alloc_pages_bulk+0x8b9/0x1870 mm/page_alloc.c:5301 alloc_pages_bulk_array_node include/linux/gfp.h:557 [inline] vm_area_alloc_pages mm/vmalloc.c:2793 [inline] __vmalloc_area_node mm/vmalloc.c:2863 [inline] __vmalloc_node_range+0x39d/0x960 mm/vmalloc.c:2966 __vmalloc_node mm/vmalloc.c:3015 [inline] vzalloc+0x67/0x80 mm/vmalloc.c:3085 deflate_comp_init+0x2e/0x140 crypto/deflate.c:47 __deflate_init crypto/deflate.c:112 [inline] deflate_init+0x20/0x150 crypto/deflate.c:154 __crypto_alloc_tfm+0x2a3/0x450 crypto/api.c:362 crypto_alloc_base+0x76/0x190 crypto/api.c:416 crypto_alloc_comp include/linux/crypto.h:731 [inline] ipcomp_alloc_tfms net/xfrm/xfrm_ipcomp.c:294 [inline] ipcomp_init_state+0x710/0xa40 net/xfrm/xfrm_ipcomp.c:350 ipcomp4_init_state+0xc2/0x8e0 net/ipv4/ipcomp.c:135 __xfrm_init_state+0x995/0x15c0 net/xfrm/xfrm_state.c:2648 xfrm_init_state+0x1a/0x70 net/xfrm/xfrm_state.c:2675 pfkey_msg2xfrm_state net/key/af_key.c:1287 [inline] pfkey_add+0x1a64/0x2cd0 net/key/af_key.c:1504 pfkey_process+0x685/0x7e0 net/key/af_key.c:2837 pfkey_sendmsg+0x43a/0x820 net/key/af_key.c:3676 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:723 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2392 ___sys_sendmsg+0xf3/0x170 net/socket.c:2446 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2475 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4665e9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3645f37188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665e9 RDX: 0000000000000000 RSI: 0000000020f56000 RDI: 0000000000000005 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffd2f41ea3f R14: 00007f3645f37300 R15: 0000000000022000