====================================================== WARNING: possible circular locking dependency detected 4.19.0-rc2+ #6 Not tainted ------------------------------------------------------ syz-executor0/24621 is trying to acquire lock: 000000006c03a52b (sb_internal){.+.+}, at: sb_start_intwrite include/linux/fs.h:1613 [inline] 000000006c03a52b (sb_internal){.+.+}, at: ext4_evict_inode+0x5e5/0x1ad0 fs/ext4/inode.c:250 but task is already holding lock: 000000007b186719 (fs_reclaim){+.+.}, at: fs_reclaim_acquire.part.97+0x0/0x30 mm/internal.h:79 kobject: 'kvm' (000000006dc68e8c): kobject_uevent_env which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (fs_reclaim){+.+.}: __fs_reclaim_acquire mm/page_alloc.c:3728 [inline] fs_reclaim_acquire.part.97+0x24/0x30 mm/page_alloc.c:3739 fs_reclaim_acquire+0x14/0x20 mm/page_alloc.c:3740 slab_pre_alloc_hook mm/slab.h:418 [inline] slab_alloc mm/slab.c:3378 [inline] kmem_cache_alloc_trace+0x2d/0x750 mm/slab.c:3618 kmalloc include/linux/slab.h:513 [inline] kzalloc include/linux/slab.h:707 [inline] smk_fetch.part.24+0x5a/0xf0 security/smack/smack_lsm.c:273 smk_fetch security/smack/smack_lsm.c:3548 [inline] smack_d_instantiate+0x94e/0xea0 security/smack/smack_lsm.c:3502 security_d_instantiate+0x5c/0xf0 security/security.c:1287 d_instantiate+0x5e/0xa0 fs/dcache.c:1870 shmem_mknod+0x189/0x1f0 mm/shmem.c:2812 vfs_mknod+0x445/0x800 fs/namei.c:3719 handle_create+0x1ff/0x730 drivers/base/devtmpfs.c:211 kobject: 'kvm' (000000006dc68e8c): fill_kobj_path: path = '/devices/virtual/misc/kvm' handle drivers/base/devtmpfs.c:374 [inline] devtmpfsd+0x27f/0x4c0 drivers/base/devtmpfs.c:400 kthread+0x35a/0x420 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:413 -> #2 (&isp->smk_lock){+.+.}: __mutex_lock_common kernel/locking/mutex.c:925 [inline] __mutex_lock+0x166/0x1710 kernel/locking/mutex.c:1073 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1088 smack_d_instantiate+0x136/0xea0 security/smack/smack_lsm.c:3369 security_d_instantiate+0x5c/0xf0 security/security.c:1287 d_instantiate_new+0x70/0x160 fs/dcache.c:1889 ext4_add_nondir+0x81/0x90 fs/ext4/namei.c:2415 ext4_symlink+0x752/0x1130 fs/ext4/namei.c:3162 vfs_symlink+0x37a/0x5d0 fs/namei.c:4127 do_symlinkat+0x242/0x2d0 fs/namei.c:4154 __do_sys_symlink fs/namei.c:4173 [inline] __se_sys_symlink fs/namei.c:4171 [inline] __x64_sys_symlink+0x59/0x80 fs/namei.c:4171 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (jbd2_handle){++++}: start_this_handle+0x5b8/0x1250 fs/jbd2/transaction.c:385 jbd2__journal_start+0x3c9/0xa90 fs/jbd2/transaction.c:439 __ext4_journal_start_sb+0x1a5/0x5f0 fs/ext4/ext4_jbd2.c:81 ext4_sample_last_mounted fs/ext4/file.c:414 [inline] ext4_file_open+0x53e/0x730 fs/ext4/file.c:439 do_dentry_open+0x499/0x1250 fs/open.c:771 vfs_open+0xa0/0xd0 fs/open.c:880 do_last fs/namei.c:3418 [inline] path_openat+0x12bf/0x5160 fs/namei.c:3534 do_filp_open+0x255/0x380 fs/namei.c:3564 do_open_execat+0x221/0x8e0 fs/exec.c:853 __do_execve_file.isra.33+0x173f/0x2540 fs/exec.c:1755 do_execveat_common fs/exec.c:1866 [inline] do_execve fs/exec.c:1883 [inline] __do_sys_execve fs/exec.c:1964 [inline] __se_sys_execve fs/exec.c:1959 [inline] __x64_sys_execve+0x8f/0xc0 fs/exec.c:1959 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (sb_internal){.+.+}: lock_acquire+0x1ed/0x520 kernel/locking/lockdep.c:3901 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x214/0x370 fs/super.c:1387 sb_start_intwrite include/linux/fs.h:1613 [inline] ext4_evict_inode+0x5e5/0x1ad0 fs/ext4/inode.c:250 evict+0x4b9/0x980 fs/inode.c:558 iput_final fs/inode.c:1547 [inline] iput+0x679/0xa90 fs/inode.c:1573 inode_lru_isolate+0x386/0x580 fs/inode.c:754 __list_lru_walk_one+0x29d/0x8c0 mm/list_lru.c:234 list_lru_walk_one+0xa5/0xe0 mm/list_lru.c:278 list_lru_shrink_walk include/linux/list_lru.h:194 [inline] prune_icache_sb+0x124/0x1c0 fs/inode.c:779 super_cache_scan+0x2bf/0x480 fs/super.c:104 do_shrink_slab+0x4cf/0xd00 mm/vmscan.c:536 shrink_slab_memcg mm/vmscan.c:601 [inline] shrink_slab+0x6f9/0x8c0 mm/vmscan.c:674 shrink_node+0x431/0x16b0 mm/vmscan.c:2735 shrink_zones mm/vmscan.c:2964 [inline] do_try_to_free_pages+0x3e7/0x1290 mm/vmscan.c:3026 try_to_free_pages+0x4d0/0xb90 mm/vmscan.c:3241 __perform_reclaim mm/page_alloc.c:3769 [inline] __alloc_pages_direct_reclaim mm/page_alloc.c:3790 [inline] __alloc_pages_slowpath+0x993/0x2d80 mm/page_alloc.c:4191 __alloc_pages_nodemask+0xa80/0xde0 mm/page_alloc.c:4390 __alloc_pages include/linux/gfp.h:473 [inline] __alloc_pages_node include/linux/gfp.h:486 [inline] kmem_getpages mm/slab.c:1409 [inline] cache_grow_begin+0x91/0x8c0 mm/slab.c:2677 fallback_alloc+0x203/0x2e0 mm/slab.c:3219 ____cache_alloc_node+0x1c7/0x1e0 mm/slab.c:3287 __do_cache_alloc mm/slab.c:3356 [inline] slab_alloc mm/slab.c:3384 [inline] kmem_cache_alloc_trace+0x214/0x750 mm/slab.c:3618 kmalloc include/linux/slab.h:513 [inline] vmx_create_vcpu+0x1c4/0x25e0 arch/x86/kvm/vmx.c:10981 kvm_arch_vcpu_create+0xe5/0x220 arch/x86/kvm/x86.c:8452 kvm_vm_ioctl_create_vcpu arch/x86/kvm/../../../virt/kvm/kvm_main.c:2476 [inline] kvm_vm_ioctl+0x470/0x1d40 arch/x86/kvm/../../../virt/kvm/kvm_main.c:2977 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0x1de/0x1720 fs/ioctl.c:685 ksys_ioctl+0xa9/0xd0 fs/ioctl.c:702 __do_sys_ioctl fs/ioctl.c:709 [inline] __se_sys_ioctl fs/ioctl.c:707 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:707 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Chain exists of: sb_internal --> &isp->smk_lock --> fs_reclaim Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(fs_reclaim); lock(&isp->smk_lock); lock(fs_reclaim); lock(sb_internal); *** DEADLOCK *** 3 locks held by syz-executor0/24621: #0: 000000007b186719 (fs_reclaim){+.+.}, at: fs_reclaim_acquire.part.97+0x0/0x30 mm/internal.h:79 #1: 000000000ee7e523 (shrinker_rwsem){++++}, at: shrink_slab_memcg mm/vmscan.c:578 [inline] #1: 000000000ee7e523 (shrinker_rwsem){++++}, at: shrink_slab+0x1d1/0x8c0 mm/vmscan.c:674 #2: 00000000776a8fa7 (&type->s_umount_key#29){++++}, at: trylock_super+0x22/0x110 fs/super.c:412 stack backtrace: CPU: 0 PID: 24621 Comm: syz-executor0 Not tainted 4.19.0-rc2+ #6 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+0x1c4/0x2b4 lib/dump_stack.c:113 print_circular_bug.isra.33.cold.54+0x1bd/0x27d kernel/locking/lockdep.c:1222 check_prev_add kernel/locking/lockdep.c:1862 [inline] check_prevs_add kernel/locking/lockdep.c:1975 [inline] validate_chain kernel/locking/lockdep.c:2416 [inline] __lock_acquire+0x33e4/0x4ec0 kernel/locking/lockdep.c:3412 lock_acquire+0x1ed/0x520 kernel/locking/lockdep.c:3901 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x214/0x370 fs/super.c:1387 sb_start_intwrite include/linux/fs.h:1613 [inline] ext4_evict_inode+0x5e5/0x1ad0 fs/ext4/inode.c:250 evict+0x4b9/0x980 fs/inode.c:558 iput_final fs/inode.c:1547 [inline] iput+0x679/0xa90 fs/inode.c:1573 inode_lru_isolate+0x386/0x580 fs/inode.c:754 __list_lru_walk_one+0x29d/0x8c0 mm/list_lru.c:234 list_lru_walk_one+0xa5/0xe0 mm/list_lru.c:278 list_lru_shrink_walk include/linux/list_lru.h:194 [inline] prune_icache_sb+0x124/0x1c0 fs/inode.c:779 super_cache_scan+0x2bf/0x480 fs/super.c:104 do_shrink_slab+0x4cf/0xd00 mm/vmscan.c:536 shrink_slab_memcg mm/vmscan.c:601 [inline] shrink_slab+0x6f9/0x8c0 mm/vmscan.c:674 shrink_node+0x431/0x16b0 mm/vmscan.c:2735 shrink_zones mm/vmscan.c:2964 [inline] do_try_to_free_pages+0x3e7/0x1290 mm/vmscan.c:3026 try_to_free_pages+0x4d0/0xb90 mm/vmscan.c:3241 __perform_reclaim mm/page_alloc.c:3769 [inline] __alloc_pages_direct_reclaim mm/page_alloc.c:3790 [inline] __alloc_pages_slowpath+0x993/0x2d80 mm/page_alloc.c:4191 __alloc_pages_nodemask+0xa80/0xde0 mm/page_alloc.c:4390 __alloc_pages include/linux/gfp.h:473 [inline] __alloc_pages_node include/linux/gfp.h:486 [inline] kmem_getpages mm/slab.c:1409 [inline] cache_grow_begin+0x91/0x8c0 mm/slab.c:2677 fallback_alloc+0x203/0x2e0 mm/slab.c:3219 ____cache_alloc_node+0x1c7/0x1e0 mm/slab.c:3287 __do_cache_alloc mm/slab.c:3356 [inline] slab_alloc mm/slab.c:3384 [inline] kmem_cache_alloc_trace+0x214/0x750 mm/slab.c:3618 kmalloc include/linux/slab.h:513 [inline] vmx_create_vcpu+0x1c4/0x25e0 arch/x86/kvm/vmx.c:10981 kvm_arch_vcpu_create+0xe5/0x220 arch/x86/kvm/x86.c:8452 kvm_vm_ioctl_create_vcpu arch/x86/kvm/../../../virt/kvm/kvm_main.c:2476 [inline] kvm_vm_ioctl+0x470/0x1d40 arch/x86/kvm/../../../virt/kvm/kvm_main.c:2977 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0x1de/0x1720 fs/ioctl.c:685 ksys_ioctl+0xa9/0xd0 fs/ioctl.c:702 __do_sys_ioctl fs/ioctl.c:709 [inline] __se_sys_ioctl fs/ioctl.c:707 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:707 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457099 Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fe2dc49cc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fe2dc49d6d4 RCX: 0000000000457099 RDX: 0000000000000000 RSI: 000000000000ae41 RDI: 0000000000000004 RBP: 0000000000930140 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000004cf2c8 R14: 00000000004c5596 R15: 0000000000000001 kobject: 'loop7' (00000000adce02c2): kobject_uevent_env kobject: 'loop7' (00000000adce02c2): fill_kobj_path: path = '/devices/virtual/block/loop7' kobject: 'kvm' (000000006dc68e8c): kobject_uevent_env kobject: 'kvm' (000000006dc68e8c): fill_kobj_path: path = '/devices/virtual/misc/kvm' kobject: 'loop2' (00000000b8a99b52): kobject_uevent_env kobject: 'loop2' (00000000b8a99b52): fill_kobj_path: path = '/devices/virtual/block/loop2' kobject: 'loop5' (000000001f6ae8d3): kobject_uevent_env kobject: 'loop5' (000000001f6ae8d3): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop7' (00000000adce02c2): kobject_uevent_env kobject: 'loop7' (00000000adce02c2): fill_kobj_path: path = '/devices/virtual/block/loop7' kobject: 'loop6' (0000000012c4fea2): kobject_uevent_env kobject: 'loop6' (0000000012c4fea2): fill_kobj_path: path = '/devices/virtual/block/loop6' kobject: 'loop2' (00000000b8a99b52): kobject_uevent_env kobject: 'loop2' (00000000b8a99b52): fill_kobj_path: path = '/devices/virtual/block/loop2' kobject: 'kvm' (000000006dc68e8c): kobject_uevent_env kobject: 'kvm' (000000006dc68e8c): fill_kobj_path: path = '/devices/virtual/misc/kvm' kobject: 'loop3' (000000003958511c): kobject_uevent_env kobject: 'loop3' (000000003958511c): fill_kobj_path: path = '/devices/virtual/block/loop3' kobject: 'loop7' (00000000adce02c2): kobject_uevent_env kobject: 'loop7' (00000000adce02c2): fill_kobj_path: path = '/devices/virtual/block/loop7' kobject: 'loop1' (000000004622bd2c): kobject_uevent_env kobject: 'loop1' (000000004622bd2c): fill_kobj_path: path = '/devices/virtual/block/loop1' kobject: 'loop2' (00000000b8a99b52): kobject_uevent_env kobject: 'loop2' (00000000b8a99b52): fill_kobj_path: path = '/devices/virtual/block/loop2' kobject: 'loop5' (000000001f6ae8d3): kobject_uevent_env kobject: 'loop5' (000000001f6ae8d3): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (0000000034a3baa0): kobject_uevent_env kobject: 'loop4' (0000000034a3baa0): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop0' (00000000400f6d9c): kobject_uevent_env kobject: 'loop0' (00000000400f6d9c): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop6' (0000000012c4fea2): kobject_uevent_env kobject: 'loop6' (0000000012c4fea2): fill_kobj_path: path = '/devices/virtual/block/loop6' kobject: 'loop1' (000000004622bd2c): kobject_uevent_env kobject: 'loop1' (000000004622bd2c): fill_kobj_path: path = '/devices/virtual/block/loop1' kobject: 'loop2' (00000000b8a99b52): kobject_uevent_env kobject: 'loop2' (00000000b8a99b52): fill_kobj_path: path = '/devices/virtual/block/loop2' kobject: 'loop0' (00000000400f6d9c): kobject_uevent_env kobject: 'loop0' (00000000400f6d9c): fill_kobj_path: path = '/devices/virtual/block/loop0' kobject: 'loop5' (000000001f6ae8d3): kobject_uevent_env kobject: 'loop5' (000000001f6ae8d3): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop3' (000000003958511c): kobject_uevent_env kobject: 'loop3' (000000003958511c): fill_kobj_path: path = '/devices/virtual/block/loop3' kobject: 'loop5' (000000001f6ae8d3): kobject_uevent_env kobject: 'loop5' (000000001f6ae8d3): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (0000000034a3baa0): kobject_uevent_env kobject: 'loop4' (0000000034a3baa0): fill_kobj_path: path = '/devices/virtual/block/loop4' kobject: 'loop7' (00000000adce02c2): kobject_uevent_env kobject: 'loop7' (00000000adce02c2): fill_kobj_path: path = '/devices/virtual/block/loop7' kobject: 'loop6' (0000000012c4fea2): kobject_uevent_env kobject: 'loop6' (0000000012c4fea2): fill_kobj_path: path = '/devices/virtual/block/loop6' kobject: 'loop5' (000000001f6ae8d3): kobject_uevent_env kobject: 'loop5' (000000001f6ae8d3): fill_kobj_path: path = '/devices/virtual/block/loop5' kobject: 'loop4' (0000000034a3baa0): kobject_uevent_env kobject: 'loop4' (0000000034a3baa0): fill_kobj_path: path = '/devices/virtual/block/loop4'