====================================================== WARNING: possible circular locking dependency detected 5.6.0-rc7-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/7206 is trying to acquire lock: ffff888090d79798 (&sb->s_type->i_mutex_key#16){+.+.}, at: inode_lock include/linux/fs.h:792 [inline] ffff888090d79798 (&sb->s_type->i_mutex_key#16){+.+.}, at: shmem_fallocate+0xef/0xdb0 mm/shmem.c:2736 but task is already holding lock: ffffffff89107970 (fs_reclaim){+.+.}, at: __fs_reclaim_acquire+0x0/0x30 mm/page_alloc.c:3728 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (fs_reclaim){+.+.}: lock_acquire+0x154/0x250 kernel/locking/lockdep.c:4484 __fs_reclaim_acquire+0x20/0x30 mm/page_alloc.c:4073 fs_reclaim_acquire mm/page_alloc.c:4084 [inline] prepare_alloc_pages+0x21d/0x4a0 mm/page_alloc.c:4667 __alloc_pages_nodemask+0xbf/0x600 mm/page_alloc.c:4719 alloc_pages_vma+0x4dd/0xd10 mm/mempolicy.c:2174 shmem_alloc_page mm/shmem.c:1499 [inline] shmem_alloc_and_acct_page+0x40e/0xbe0 mm/shmem.c:1524 shmem_getpage_gfp+0x21b7/0x2db0 mm/shmem.c:1838 shmem_getpage mm/shmem.c:154 [inline] shmem_write_begin+0xcd/0x1a0 mm/shmem.c:2488 generic_perform_write+0x23b/0x4e0 mm/filemap.c:3287 __generic_file_write_iter+0x22b/0x4e0 mm/filemap.c:3416 generic_file_write_iter+0x4a6/0x650 mm/filemap.c:3448 call_write_iter include/linux/fs.h:1902 [inline] new_sync_write fs/read_write.c:483 [inline] __vfs_write+0x549/0x710 fs/read_write.c:496 vfs_write+0x271/0x570 fs/read_write.c:558 ksys_write+0x115/0x220 fs/read_write.c:611 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (&sb->s_type->i_mutex_key#16){+.+.}: check_prev_add kernel/locking/lockdep.c:2475 [inline] check_prevs_add kernel/locking/lockdep.c:2580 [inline] validate_chain+0x1507/0x7be0 kernel/locking/lockdep.c:2970 __lock_acquire+0xc5a/0x1bc0 kernel/locking/lockdep.c:3954 lock_acquire+0x154/0x250 kernel/locking/lockdep.c:4484 down_write+0x55/0x130 kernel/locking/rwsem.c:1534 inode_lock include/linux/fs.h:792 [inline] shmem_fallocate+0xef/0xdb0 mm/shmem.c:2736 ashmem_shrink_scan+0x367/0x4a0 drivers/staging/android/ashmem.c:490 do_shrink_slab+0x36f/0x5c0 mm/vmscan.c:512 shrink_slab+0x188/0x2b0 mm/vmscan.c:673 shrink_node_memcgs+0x414/0x5e0 mm/vmscan.c:2676 shrink_node+0xb66/0x19c0 mm/vmscan.c:2780 shrink_zones+0x27c/0x8d0 mm/vmscan.c:2983 do_try_to_free_pages+0x229/0xc30 mm/vmscan.c:3036 try_to_free_pages+0x328/0xb60 mm/vmscan.c:3275 __perform_reclaim mm/page_alloc.c:4113 [inline] __alloc_pages_direct_reclaim mm/page_alloc.c:4134 [inline] __alloc_pages_slowpath+0xe82/0x22a0 mm/page_alloc.c:4537 __alloc_pages_nodemask+0x3c4/0x600 mm/page_alloc.c:4751 __alloc_pages include/linux/gfp.h:496 [inline] __alloc_pages_node include/linux/gfp.h:509 [inline] kmem_getpages+0x49/0x930 mm/slab.c:1367 cache_grow_begin+0x7b/0x2e0 mm/slab.c:2600 fallback_alloc+0x135/0x1d0 mm/slab.c:3147 __do_cache_alloc mm/slab.c:3284 [inline] slab_alloc mm/slab.c:3312 [inline] kmem_cache_alloc+0x163/0x2d0 mm/slab.c:3484 getname_flags+0xb8/0x610 fs/namei.c:138 getname fs/namei.c:209 [inline] user_path_mountpoint_at+0x22/0x40 fs/namei.c:2822 ksys_umount+0xfd/0xf10 fs/namespace.c:1683 __do_sys_umount fs/namespace.c:1709 [inline] __se_sys_umount fs/namespace.c:1707 [inline] __x64_sys_umount+0x56/0x60 fs/namespace.c:1707 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(fs_reclaim); lock(&sb->s_type->i_mutex_key#16); lock(fs_reclaim); lock(&sb->s_type->i_mutex_key#16); *** DEADLOCK *** 2 locks held by syz-executor.1/7206: #0: ffffffff89107970 (fs_reclaim){+.+.}, at: __fs_reclaim_acquire+0x0/0x30 mm/page_alloc.c:3728 #1: ffffffff890ffe58 (shrinker_rwsem){++++}, at: shrink_slab+0xa8/0x2b0 mm/vmscan.c:663 stack backtrace: CPU: 1 PID: 7206 Comm: syz-executor.1 Not tainted 5.6.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1e9/0x30e lib/dump_stack.c:118 print_circular_bug+0xc3f/0xe70 kernel/locking/lockdep.c:1684 check_noncircular+0x1fb/0x3a0 kernel/locking/lockdep.c:1808 check_prev_add kernel/locking/lockdep.c:2475 [inline] check_prevs_add kernel/locking/lockdep.c:2580 [inline] validate_chain+0x1507/0x7be0 kernel/locking/lockdep.c:2970 __lock_acquire+0xc5a/0x1bc0 kernel/locking/lockdep.c:3954 lock_acquire+0x154/0x250 kernel/locking/lockdep.c:4484 down_write+0x55/0x130 kernel/locking/rwsem.c:1534 inode_lock include/linux/fs.h:792 [inline] shmem_fallocate+0xef/0xdb0 mm/shmem.c:2736 ashmem_shrink_scan+0x367/0x4a0 drivers/staging/android/ashmem.c:490 do_shrink_slab+0x36f/0x5c0 mm/vmscan.c:512 shrink_slab+0x188/0x2b0 mm/vmscan.c:673 shrink_node_memcgs+0x414/0x5e0 mm/vmscan.c:2676 shrink_node+0xb66/0x19c0 mm/vmscan.c:2780 shrink_zones+0x27c/0x8d0 mm/vmscan.c:2983 do_try_to_free_pages+0x229/0xc30 mm/vmscan.c:3036 try_to_free_pages+0x328/0xb60 mm/vmscan.c:3275 __perform_reclaim mm/page_alloc.c:4113 [inline] __alloc_pages_direct_reclaim mm/page_alloc.c:4134 [inline] __alloc_pages_slowpath+0xe82/0x22a0 mm/page_alloc.c:4537 __alloc_pages_nodemask+0x3c4/0x600 mm/page_alloc.c:4751 __alloc_pages include/linux/gfp.h:496 [inline] __alloc_pages_node include/linux/gfp.h:509 [inline] kmem_getpages+0x49/0x930 mm/slab.c:1367 cache_grow_begin+0x7b/0x2e0 mm/slab.c:2600 fallback_alloc+0x135/0x1d0 mm/slab.c:3147 __do_cache_alloc mm/slab.c:3284 [inline] slab_alloc mm/slab.c:3312 [inline] kmem_cache_alloc+0x163/0x2d0 mm/slab.c:3484 getname_flags+0xb8/0x610 fs/namei.c:138 getname fs/namei.c:209 [inline] user_path_mountpoint_at+0x22/0x40 fs/namei.c:2822 ksys_umount+0xfd/0xf10 fs/namespace.c:1683 __do_sys_umount fs/namespace.c:1709 [inline] __se_sys_umount fs/namespace.c:1707 [inline] __x64_sys_umount+0x56/0x60 fs/namespace.c:1707 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45f277 Code: 64 89 04 25 d0 02 00 00 58 5f ff d0 48 89 c7 e8 2f be ff ff 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 4d 8c fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ffeff9b1ef8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: ffffffffffffffda RBX: 000000000011593f RCX: 000000000045f277 RDX: 000000000000000c RSI: 0000000000000002 RDI: 00007ffeff9b3030 RBP: 00000000000015b2 R08: 0000000000000001 R09: 0000000000fba940 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffeff9b3030 R13: 00007ffeff9b3020 R14: 0000000000000000 R15: 00007ffeff9b3030