====================================================== WARNING: possible circular locking dependency detected 5.14.0-rc1-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/10889 is trying to acquire lock: ffffffff8c7d6aa0 (fs_reclaim){+.+.}-{0:0}, at: __fs_reclaim_acquire+0x0/0x30 mm/page_alloc.c:4210 but task is already holding lock: ffff8880b9c4d0c8 (lock#2){-.-.}-{2:2}, at: local_lock_acquire+0x7/0x130 include/linux/local_lock_internal.h:41 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (lock#2){-.-.}-{2:2}: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 local_lock_acquire+0x23/0x130 include/linux/local_lock_internal.h:42 free_unref_page+0x242/0x550 mm/page_alloc.c:3427 mm_free_pgd kernel/fork.c:636 [inline] __mmdrop+0xae/0x3f0 kernel/fork.c:687 mmdrop include/linux/sched/mm.h:49 [inline] finish_task_switch+0x221/0x630 kernel/sched/core.c:4582 context_switch kernel/sched/core.c:4686 [inline] __schedule+0xc0f/0x11f0 kernel/sched/core.c:5940 preempt_schedule_irq+0xe3/0x190 kernel/sched/core.c:6328 irqentry_exit+0x56/0x90 kernel/entry/common.c:427 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 lock_acquire+0x1e7/0x4a0 kernel/locking/lockdep.c:5629 down_write+0x97/0x170 kernel/locking/rwsem.c:1406 i_mmap_lock_write include/linux/fs.h:494 [inline] __vma_adjust+0x6a2/0x3a50 mm/mmap.c:850 __split_vma+0x378/0x4a0 include/linux/mm.h:2546 mprotect_fixup+0x795/0x890 mm/mprotect.c:483 do_mprotect_pkey+0x7ab/0xa40 mm/mprotect.c:636 __do_sys_mprotect mm/mprotect.c:662 [inline] __se_sys_mprotect mm/mprotect.c:659 [inline] __x64_sys_mprotect+0x7c/0x90 mm/mprotect.c:659 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #1 (&mapping->i_mmap_rwsem){++++}-{3:3}: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 down_write+0x97/0x170 kernel/locking/rwsem.c:1406 i_mmap_lock_write include/linux/fs.h:494 [inline] dma_resv_lockdep+0x3b5/0x63a drivers/dma-buf/dma-resv.c:689 do_one_initcall+0x197/0x3f0 init/main.c:1282 do_initcall_level+0x14a/0x1f5 init/main.c:1355 do_initcalls+0x4b/0x8c init/main.c:1371 kernel_init_freeable+0x3f1/0x57e init/main.c:1593 kernel_init+0x19/0x2a0 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+0x4f9/0x5b30 kernel/locking/lockdep.c:3174 validate_chain kernel/locking/lockdep.c:3789 [inline] __lock_acquire+0x4476/0x6100 kernel/locking/lockdep.c:5015 lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __fs_reclaim_acquire+0x20/0x30 mm/page_alloc.c:4552 fs_reclaim_acquire+0x59/0xf0 mm/page_alloc.c:4566 prepare_alloc_pages+0x151/0x5a0 mm/page_alloc.c:5164 __alloc_pages+0x14d/0x5f0 mm/page_alloc.c:5363 stack_depot_save+0x361/0x490 lib/stackdepot.c:303 save_stack+0xf9/0x1f0 mm/page_owner.c:120 __set_page_owner+0x42/0x2f0 mm/page_owner.c:181 prep_new_page mm/page_alloc.c:2433 [inline] __alloc_pages_bulk+0x9f2/0x1090 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+0x3ad/0x7f0 mm/vmalloc.c:2966 __vmalloc_node mm/vmalloc.c:3015 [inline] vmalloc+0x75/0x80 mm/vmalloc.c:3048 netlink_alloc_large_skb net/netlink/af_netlink.c:1191 [inline] netlink_sendmsg+0x703/0xe00 net/netlink/af_netlink.c:1904 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg net/socket.c:723 [inline] kernel_sendmsg+0xf5/0x130 net/socket.c:743 sock_no_sendpage+0x150/0x1b0 net/core/sock.c:2959 kernel_sendpage+0x2ca/0x370 net/socket.c:3673 sock_sendpage+0x7e/0xb0 net/socket.c:1002 pipe_to_sendpage+0x258/0x340 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x351/0x8b0 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0x172/0x200 fs/splice.c:746 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0xe6/0x1c0 fs/splice.c:936 splice_direct_to_actor+0x529/0xd00 fs/splice.c:891 do_splice_direct+0x282/0x3e0 fs/splice.c:979 do_sendfile+0x885/0x1200 fs/read_write.c:1260 __do_sys_sendfile64 fs/read_write.c:1325 [inline] __se_sys_sendfile64+0x145/0x1a0 fs/read_write.c:1311 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/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 --> &mapping->i_mmap_rwsem --> lock#2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(lock#2); lock(&mapping->i_mmap_rwsem); lock(lock#2); lock(fs_reclaim); *** DEADLOCK *** 1 lock held by syz-executor.4/10889: #0: ffff8880b9c4d0c8 (lock#2){-.-.}-{2:2}, at: local_lock_acquire+0x7/0x130 include/linux/local_lock_internal.h:41 stack backtrace: CPU: 0 PID: 10889 Comm: syz-executor.4 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+0x1ae/0x29f lib/dump_stack.c:105 print_circular_bug+0xb17/0xdc0 kernel/locking/lockdep.c:2009 check_noncircular+0x2cc/0x390 kernel/locking/lockdep.c:2131 check_prev_add kernel/locking/lockdep.c:3051 [inline] check_prevs_add+0x4f9/0x5b30 kernel/locking/lockdep.c:3174 validate_chain kernel/locking/lockdep.c:3789 [inline] __lock_acquire+0x4476/0x6100 kernel/locking/lockdep.c:5015 lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __fs_reclaim_acquire+0x20/0x30 mm/page_alloc.c:4552 fs_reclaim_acquire+0x59/0xf0 mm/page_alloc.c:4566 prepare_alloc_pages+0x151/0x5a0 mm/page_alloc.c:5164 __alloc_pages+0x14d/0x5f0 mm/page_alloc.c:5363 stack_depot_save+0x361/0x490 lib/stackdepot.c:303 save_stack+0xf9/0x1f0 mm/page_owner.c:120 __set_page_owner+0x42/0x2f0 mm/page_owner.c:181 prep_new_page mm/page_alloc.c:2433 [inline] __alloc_pages_bulk+0x9f2/0x1090 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+0x3ad/0x7f0 mm/vmalloc.c:2966 __vmalloc_node mm/vmalloc.c:3015 [inline] vmalloc+0x75/0x80 mm/vmalloc.c:3048 netlink_alloc_large_skb net/netlink/af_netlink.c:1191 [inline] netlink_sendmsg+0x703/0xe00 net/netlink/af_netlink.c:1904 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg net/socket.c:723 [inline] kernel_sendmsg+0xf5/0x130 net/socket.c:743 sock_no_sendpage+0x150/0x1b0 net/core/sock.c:2959 kernel_sendpage+0x2ca/0x370 net/socket.c:3673 sock_sendpage+0x7e/0xb0 net/socket.c:1002 pipe_to_sendpage+0x258/0x340 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x351/0x8b0 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0x172/0x200 fs/splice.c:746 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0xe6/0x1c0 fs/splice.c:936 splice_direct_to_actor+0x529/0xd00 fs/splice.c:891 do_splice_direct+0x282/0x3e0 fs/splice.c:979 do_sendfile+0x885/0x1200 fs/read_write.c:1260 __do_sys_sendfile64 fs/read_write.c:1325 [inline] __se_sys_sendfile64+0x145/0x1a0 fs/read_write.c:1311 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/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:00007f06b0e84188 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665d9 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000005 RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000100000002 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffe4f9649bf R14: 00007f06b0e84300 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: 10889, name: syz-executor.4 INFO: lockdep is turned off. irq event stamp: 3468 hardirqs last enabled at (3467): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (3467): [] _raw_spin_unlock_irqrestore+0x8b/0x120 kernel/locking/spinlock.c:191 hardirqs last disabled at (3468): [] __alloc_pages_bulk+0x801/0x1090 mm/page_alloc.c:5279 softirqs last enabled at (3458): [] netlink_insert+0xf70/0x1370 net/netlink/af_netlink.c:600 softirqs last disabled at (3456): [] spin_lock_bh include/linux/spinlock.h:359 [inline] softirqs last disabled at (3456): [] release_sock+0x2c/0x1c0 net/core/sock.c:3177 CPU: 0 PID: 10889 Comm: syz-executor.4 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+0x1ae/0x29f lib/dump_stack.c:105 ___might_sleep+0x4e5/0x6b0 kernel/sched/core.c:9154 prepare_alloc_pages+0x1c0/0x5a0 mm/page_alloc.c:5167 __alloc_pages+0x14d/0x5f0 mm/page_alloc.c:5363 stack_depot_save+0x361/0x490 lib/stackdepot.c:303 save_stack+0xf9/0x1f0 mm/page_owner.c:120 __set_page_owner+0x42/0x2f0 mm/page_owner.c:181 prep_new_page mm/page_alloc.c:2433 [inline] __alloc_pages_bulk+0x9f2/0x1090 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+0x3ad/0x7f0 mm/vmalloc.c:2966 __vmalloc_node mm/vmalloc.c:3015 [inline] vmalloc+0x75/0x80 mm/vmalloc.c:3048 netlink_alloc_large_skb net/netlink/af_netlink.c:1191 [inline] netlink_sendmsg+0x703/0xe00 net/netlink/af_netlink.c:1904 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg net/socket.c:723 [inline] kernel_sendmsg+0xf5/0x130 net/socket.c:743 sock_no_sendpage+0x150/0x1b0 net/core/sock.c:2959 kernel_sendpage+0x2ca/0x370 net/socket.c:3673 sock_sendpage+0x7e/0xb0 net/socket.c:1002 pipe_to_sendpage+0x258/0x340 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x351/0x8b0 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0x172/0x200 fs/splice.c:746 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0xe6/0x1c0 fs/splice.c:936 splice_direct_to_actor+0x529/0xd00 fs/splice.c:891 do_splice_direct+0x282/0x3e0 fs/splice.c:979 do_sendfile+0x885/0x1200 fs/read_write.c:1260 __do_sys_sendfile64 fs/read_write.c:1325 [inline] __se_sys_sendfile64+0x145/0x1a0 fs/read_write.c:1311 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/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:00007f06b0e84188 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665d9 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000005 RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000100000002 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffe4f9649bf R14: 00007f06b0e84300 R15: 0000000000022000