====================================================== WARNING: possible circular locking dependency detected 4.19.0-rc2+ #6 Not tainted ------------------------------------------------------ kswapd0/1375 is trying to acquire lock: 00000000a352a8da (sb_internal){.+.+}, at: sb_start_intwrite include/linux/fs.h:1613 [inline] 00000000a352a8da (sb_internal){.+.+}, at: ext4_evict_inode+0x5e5/0x1ad0 fs/ext4/inode.c:250 but task is already holding lock: 00000000b2581da3 (fs_reclaim){+.+.}, at: __fs_reclaim_acquire+0x0/0x30 mm/page_alloc.c:4539 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 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 dentry_unlink_inode+0x461/0x5e0 fs/dcache.c:374 __dentry_kill+0x44c/0x7a0 fs/dcache.c:566 shrink_dentry_list+0x32f/0x800 fs/dcache.c:1079 prune_dcache_sb+0x12f/0x1c0 fs/dcache.c:1171 super_cache_scan+0x270/0x480 fs/super.c:102 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 kswapd_shrink_node mm/vmscan.c:3457 [inline] balance_pgdat+0x7ca/0x1000 mm/vmscan.c:3567 kswapd+0x857/0x12d0 mm/vmscan.c:3789 kthread+0x35a/0x420 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:413 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 kswapd0/1375: #0: 00000000b2581da3 (fs_reclaim){+.+.}, at: __fs_reclaim_acquire+0x0/0x30 mm/page_alloc.c:4539 #1: 00000000763ea7d2 (shrinker_rwsem){++++}, at: shrink_slab_memcg mm/vmscan.c:578 [inline] #1: 00000000763ea7d2 (shrinker_rwsem){++++}, at: shrink_slab+0x1d1/0x8c0 mm/vmscan.c:674 #2: 00000000e6a3d1c0 (&type->s_umount_key#29){++++}, at: trylock_super+0x22/0x110 fs/super.c:412 stack backtrace: CPU: 0 PID: 1375 Comm: kswapd0 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 dentry_unlink_inode+0x461/0x5e0 fs/dcache.c:374 __dentry_kill+0x44c/0x7a0 fs/dcache.c:566 shrink_dentry_list+0x32f/0x800 fs/dcache.c:1079 prune_dcache_sb+0x12f/0x1c0 fs/dcache.c:1171 super_cache_scan+0x270/0x480 fs/super.c:102 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 kswapd_shrink_node mm/vmscan.c:3457 [inline] balance_pgdat+0x7ca/0x1000 mm/vmscan.c:3567 kswapd+0x857/0x12d0 mm/vmscan.c:3789 kthread+0x35a/0x420 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:413 kobject: 'kvm' (000000002199b770): kobject_uevent_env ================================================================== BUG: KASAN: slab-out-of-bounds in perf_tp_event+0xb14/0xbe0 kernel/events/core.c:8281 kobject: 'loop7' (0000000013bec597): kobject_uevent_env Write of size 32 at addr ffff880010e97f80 by task syz-executor4/27565 kobject: 'loop7' (0000000013bec597): fill_kobj_path: path = '/devices/virtual/block/loop7' CPU: 0 PID: 27565 Comm: syz-executor4 Not tainted 4.19.0-rc2+ #6 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: Allocated by task 5324: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc+0x12e/0x730 mm/slab.c:3554 getname_flags+0xd0/0x5a0 fs/namei.c:140 user_path_at_empty+0x2d/0x50 fs/namei.c:2608 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0x129/0x210 fs/stat.c:185 vfs_lstat include/linux/fs.h:3128 [inline] __do_sys_newlstat+0x8f/0x110 fs/stat.c:350 __se_sys_newlstat fs/stat.c:344 [inline] __x64_sys_newlstat+0x54/0x80 fs/stat.c:344 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 5324: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kmem_cache_free+0x83/0x290 mm/slab.c:3756 putname+0xf2/0x130 fs/namei.c:261 filename_lookup+0x39a/0x520 fs/namei.c:2357 user_path_at_empty+0x40/0x50 fs/namei.c:2608 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0x129/0x210 fs/stat.c:185 vfs_lstat include/linux/fs.h:3128 [inline] __do_sys_newlstat+0x8f/0x110 fs/stat.c:350 __se_sys_newlstat fs/stat.c:344 [inline] __x64_sys_newlstat+0x54/0x80 fs/stat.c:344 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff880010e96080 which belongs to the cache names_cache of size 4096 The buggy address is located 3840 bytes to the right of 4096-byte region [ffff880010e96080, ffff880010e97080) The buggy address belongs to the page: page:ffffea000043a580 count:1 mapcount:0 mapping:ffff8801da972c00 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffffea0001732c88 ffffea000043aa88 ffff8801da972c00 raw: 0000000000000000 ffff880010e96080 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff880010e97e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff880010e97f00: fc fc fc fc fc fc fc fc fc fc fc fc f1 f1 f1 f1 >ffff880010e97f80: fc fc fc fc f2 f2 f2 f2 fc fc fc fc fc fc fc fc ^ ffff880010e98000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff880010e98080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================