====================================================== WARNING: possible circular locking dependency detected 5.14.0-rc1-next-20210715-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.3/16903 is trying to acquire lock: ffffffff8ba9f4a0 (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: -> #1 (lock#2){-.-.}-{2:2}: local_lock_acquire include/linux/local_lock_internal.h:42 [inline] free_unref_page+0x1bf/0x690 mm/page_alloc.c:3427 mm_free_pgd kernel/fork.c:636 [inline] __mmdrop+0xcb/0x3f0 kernel/fork.c:738 mmdrop include/linux/sched/mm.h:49 [inline] mmdrop_lazy_tlb include/linux/sched/mm.h:62 [inline] finish_task_switch.isra.0+0x6bf/0xa20 kernel/sched/core.c:4587 context_switch kernel/sched/core.c:4703 [inline] __schedule+0x942/0x26f0 kernel/sched/core.c:5957 preempt_schedule_irq+0x4e/0x90 kernel/sched/core.c:6345 irqentry_exit+0x31/0x80 kernel/entry/common.c:427 asm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:629 lock_release+0x31/0x720 kernel/locking/lockdep.c:5633 might_alloc include/linux/sched/mm.h:220 [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_trace+0x42/0x3c0 mm/slub.c:3006 kmalloc include/linux/slab.h:591 [inline] kernfs_get_open_node fs/kernfs/file.c:552 [inline] kernfs_fop_open+0x957/0xd40 fs/kernfs/file.c:698 do_dentry_open+0x4c8/0x11d0 fs/open.c:826 do_open fs/namei.c:3374 [inline] path_openat+0x1c23/0x27f0 fs/namei.c:3507 do_filp_open+0x1aa/0x400 fs/namei.c:3534 do_sys_openat2+0x16d/0x420 fs/open.c:1204 do_sys_open fs/open.c:1220 [inline] __do_sys_open fs/open.c:1228 [inline] __se_sys_open fs/open.c:1224 [inline] __x64_sys_open+0x119/0x1c0 fs/open.c:1224 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 -> #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] __vmalloc+0x69/0x80 mm/vmalloc.c:3029 pcpu_mem_zalloc mm/percpu.c:517 [inline] pcpu_mem_zalloc+0x51/0xa0 mm/percpu.c:509 pcpu_alloc_chunk mm/percpu.c:1460 [inline] pcpu_create_chunk+0x123/0x720 mm/percpu-vm.c:338 pcpu_alloc+0xfa1/0x1350 mm/percpu.c:1838 gro_cells_init+0x28/0x250 net/core/gro_cells.c:73 ip_tunnel_init+0x172/0x480 net/ipv4/ip_tunnel.c:1237 register_netdevice+0x51e/0x1500 net/core/dev.c:10267 __ip_tunnel_create+0x398/0x5c0 net/ipv4/ip_tunnel.c:267 ip_tunnel_init_net+0x2e4/0x9d0 net/ipv4/ip_tunnel.c:1069 ops_init+0xaf/0x470 net/core/net_namespace.c:140 setup_net+0x40f/0xa30 net/core/net_namespace.c:333 copy_net_ns+0x319/0x760 net/core/net_namespace.c:474 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x920 kernel/fork.c:3053 __do_sys_unshare kernel/fork.c:3127 [inline] __se_sys_unshare kernel/fork.c:3125 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3125 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: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(lock#2); lock(fs_reclaim); lock(lock#2); lock(fs_reclaim); *** DEADLOCK *** 4 locks held by syz-executor.3/16903: #0: ffffffff8d0b9dd0 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x2f5/0x760 net/core/net_namespace.c:470 #1: ffffffff8d0cd3e8 (rtnl_mutex){+.+.}-{3:3}, at: ip_tunnel_init_net+0x2d5/0x9d0 net/ipv4/ip_tunnel.c:1068 #2: ffffffff8ba7ff68 (pcpu_alloc_mutex){+.+.}-{3:3}, at: pcpu_alloc+0xb12/0x1350 mm/percpu.c:1778 #3: ffff8880b9c4d660 (lock#2){-.-.}-{2:2}, at: __alloc_pages_bulk+0x4ad/0x1870 mm/page_alloc.c:5279 stack backtrace: CPU: 0 PID: 16903 Comm: syz-executor.3 Not tainted 5.14.0-rc1-next-20210715-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] __vmalloc+0x69/0x80 mm/vmalloc.c:3029 pcpu_mem_zalloc mm/percpu.c:517 [inline] pcpu_mem_zalloc+0x51/0xa0 mm/percpu.c:509 pcpu_alloc_chunk mm/percpu.c:1460 [inline] pcpu_create_chunk+0x123/0x720 mm/percpu-vm.c:338 pcpu_alloc+0xfa1/0x1350 mm/percpu.c:1838 gro_cells_init+0x28/0x250 net/core/gro_cells.c:73 ip_tunnel_init+0x172/0x480 net/ipv4/ip_tunnel.c:1237 register_netdevice+0x51e/0x1500 net/core/dev.c:10267 __ip_tunnel_create+0x398/0x5c0 net/ipv4/ip_tunnel.c:267 ip_tunnel_init_net+0x2e4/0x9d0 net/ipv4/ip_tunnel.c:1069 ops_init+0xaf/0x470 net/core/net_namespace.c:140 setup_net+0x40f/0xa30 net/core/net_namespace.c:333 copy_net_ns+0x319/0x760 net/core/net_namespace.c:474 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x920 kernel/fork.c:3053 __do_sys_unshare kernel/fork.c:3127 [inline] __se_sys_unshare kernel/fork.c:3125 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3125 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:0x4665d9 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:00007f07b326a188 EFLAGS: 00000246 ORIG_RAX: 0000000000000110 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665d9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000060000200 RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffc9ab65acf R14: 00007f07b326a300 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: 16903, name: syz-executor.3 INFO: lockdep is turned off. irq event stamp: 3638 hardirqs last enabled at (3637): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (3637): [] _raw_spin_unlock_irqrestore+0x50/0x70 kernel/locking/spinlock.c:191 hardirqs last disabled at (3638): [] __alloc_pages_bulk+0x1017/0x1870 mm/page_alloc.c:5279 softirqs last enabled at (3564): [] inet6_fill_ifla6_attrs+0x1b10/0x20b0 net/ipv6/addrconf.c:5643 softirqs last disabled at (3562): [] inet6_fill_ifla6_attrs+0x1ac5/0x20b0 net/ipv6/addrconf.c:5641 CPU: 0 PID: 16903 Comm: syz-executor.3 Not tainted 5.14.0-rc1-next-20210715-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+0x1f3/0x239 kernel/sched/core.c:9182 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] __vmalloc+0x69/0x80 mm/vmalloc.c:3029 pcpu_mem_zalloc mm/percpu.c:517 [inline] pcpu_mem_zalloc+0x51/0xa0 mm/percpu.c:509 pcpu_alloc_chunk mm/percpu.c:1460 [inline] pcpu_create_chunk+0x123/0x720 mm/percpu-vm.c:338 pcpu_alloc+0xfa1/0x1350 mm/percpu.c:1838 gro_cells_init+0x28/0x250 net/core/gro_cells.c:73 ip_tunnel_init+0x172/0x480 net/ipv4/ip_tunnel.c:1237 register_netdevice+0x51e/0x1500 net/core/dev.c:10267 __ip_tunnel_create+0x398/0x5c0 net/ipv4/ip_tunnel.c:267 ip_tunnel_init_net+0x2e4/0x9d0 net/ipv4/ip_tunnel.c:1069 ops_init+0xaf/0x470 net/core/net_namespace.c:140 setup_net+0x40f/0xa30 net/core/net_namespace.c:333 copy_net_ns+0x319/0x760 net/core/net_namespace.c:474 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x920 kernel/fork.c:3053 __do_sys_unshare kernel/fork.c:3127 [inline] __se_sys_unshare kernel/fork.c:3125 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3125 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:0x4665d9 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:00007f07b326a188 EFLAGS: 00000246 ORIG_RAX: 0000000000000110 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665d9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000060000200 RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffc9ab65acf R14: 00007f07b326a300 R15: 0000000000022000