====================================================== WARNING: possible circular locking dependency detected 5.14.0-rc1-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/15371 is trying to acquire lock: ffffffff8c7d6b20 (fs_reclaim){+.+.}-{0:0}, at: __fs_reclaim_acquire+0x0/0x30 mm/page_alloc.c:4210 but task is already holding lock: ffff8880b9d4d0c8 (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: -> #1 (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_notrace+0x12c/0x170 kernel/sched/core.c:6179 preempt_schedule_notrace_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:36 rcu_read_unlock_sched_notrace include/linux/rcupdate.h:809 [inline] trace_lock_release+0xa1/0x150 include/trace/events/lock.h:58 lock_release+0x81/0x7b0 kernel/locking/lockdep.c:5636 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+0x41/0x340 mm/slub.c:2994 getname_flags+0xba/0x640 fs/namei.c:138 user_path_at_empty+0x28/0x50 fs/namei.c:2747 user_path_at include/linux/namei.h:57 [inline] do_faccessat+0x403/0x910 fs/open.c:425 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 -> #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:3029 snd_dma_vmalloc_alloc+0x48/0x70 sound/core/memalloc.c:236 __snd_dma_alloc_pages sound/core/memalloc.c:38 [inline] snd_dma_alloc_pages+0x104/0x1d0 sound/core/memalloc.c:71 do_alloc_pages sound/core/pcm_memory.c:43 [inline] snd_pcm_lib_malloc_pages+0x323/0x720 sound/core/pcm_memory.c:383 snd_pcm_hw_params+0x46d/0x1740 sound/core/pcm_native.c:705 snd_pcm_oss_change_params_locked+0x245a/0x4390 sound/core/oss/pcm_oss.c:947 snd_pcm_oss_make_ready_locked sound/core/oss/pcm_oss.c:1173 [inline] snd_pcm_oss_write1+0x238/0xdc0 sound/core/oss/pcm_oss.c:1391 vfs_write+0x289/0xc90 fs/read_write.c:603 ksys_write+0x171/0x2a0 fs/read_write.c:658 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: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(lock#2); lock(fs_reclaim); lock(lock#2); lock(fs_reclaim); *** DEADLOCK *** 2 locks held by syz-executor.5/15371: #0: ffff888021c56440 (&runtime->oss.params_lock){+.+.}-{3:3}, at: snd_pcm_oss_write1+0x1c4/0xdc0 sound/core/oss/pcm_oss.c:1387 #1: ffff8880b9d4d0c8 (lock#2){-.-.}-{2:2}, at: local_lock_acquire+0x7/0x130 include/linux/local_lock_internal.h:41 stack backtrace: CPU: 1 PID: 15371 Comm: syz-executor.5 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:3029 snd_dma_vmalloc_alloc+0x48/0x70 sound/core/memalloc.c:236 __snd_dma_alloc_pages sound/core/memalloc.c:38 [inline] snd_dma_alloc_pages+0x104/0x1d0 sound/core/memalloc.c:71 do_alloc_pages sound/core/pcm_memory.c:43 [inline] snd_pcm_lib_malloc_pages+0x323/0x720 sound/core/pcm_memory.c:383 snd_pcm_hw_params+0x46d/0x1740 sound/core/pcm_native.c:705 snd_pcm_oss_change_params_locked+0x245a/0x4390 sound/core/oss/pcm_oss.c:947 snd_pcm_oss_make_ready_locked sound/core/oss/pcm_oss.c:1173 [inline] snd_pcm_oss_write1+0x238/0xdc0 sound/core/oss/pcm_oss.c:1391 vfs_write+0x289/0xc90 fs/read_write.c:603 ksys_write+0x171/0x2a0 fs/read_write.c:658 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:00007f0ea0386188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665d9 RDX: 0000000000c00000 RSI: 0000000020002000 RDI: 0000000000000004 RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffe86956c5f R14: 00007f0ea0386300 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: 15371, name: syz-executor.5 INFO: lockdep is turned off. irq event stamp: 410 hardirqs last enabled at (409): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (409): [] _raw_spin_unlock_irqrestore+0x8b/0x120 kernel/locking/spinlock.c:191 hardirqs last disabled at (410): [] __alloc_pages_bulk+0x801/0x1090 mm/page_alloc.c:5279 softirqs last enabled at (0): [] copy_process+0x147b/0x5b00 kernel/fork.c:2065 softirqs last disabled at (0): [<0000000000000000>] 0x0 CPU: 1 PID: 15371 Comm: syz-executor.5 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:3029 snd_dma_vmalloc_alloc+0x48/0x70 sound/core/memalloc.c:236 __snd_dma_alloc_pages sound/core/memalloc.c:38 [inline] snd_dma_alloc_pages+0x104/0x1d0 sound/core/memalloc.c:71 do_alloc_pages sound/core/pcm_memory.c:43 [inline] snd_pcm_lib_malloc_pages+0x323/0x720 sound/core/pcm_memory.c:383 snd_pcm_hw_params+0x46d/0x1740 sound/core/pcm_native.c:705 snd_pcm_oss_change_params_locked+0x245a/0x4390 sound/core/oss/pcm_oss.c:947 snd_pcm_oss_make_ready_locked sound/core/oss/pcm_oss.c:1173 [inline] snd_pcm_oss_write1+0x238/0xdc0 sound/core/oss/pcm_oss.c:1391 vfs_write+0x289/0xc90 fs/read_write.c:603 ksys_write+0x171/0x2a0 fs/read_write.c:658 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:00007f0ea0386188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665d9 RDX: 0000000000c00000 RSI: 0000000020002000 RDI: 0000000000000004 RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffe86956c5f R14: 00007f0ea0386300 R15: 0000000000022000