Process accounting resumed ====================================================== WARNING: possible circular locking dependency detected 5.1.0+ #2 Not tainted ------------------------------------------------------ syz-executor.2/13282 is trying to acquire lock: 0000000059010f99 (&ovl_i_mutex_key[depth]){+.+.}, at: inode_lock include/linux/fs.h:772 [inline] 0000000059010f99 (&ovl_i_mutex_key[depth]){+.+.}, at: ovl_write_iter+0x148/0xc20 fs/overlayfs/file.c:231 but task is already holding lock: 00000000b7dd5e3c (&acct->lock#2){+.+.}, at: acct_get kernel/acct.c:161 [inline] 00000000b7dd5e3c (&acct->lock#2){+.+.}, at: slow_acct_process kernel/acct.c:577 [inline] 00000000b7dd5e3c (&acct->lock#2){+.+.}, at: acct_process+0x2e5/0x61e kernel/acct.c:605 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&acct->lock#2){+.+.}: __mutex_lock_common kernel/locking/mutex.c:925 [inline] __mutex_lock+0xf7/0x1310 kernel/locking/mutex.c:1072 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087 acct_pin_kill+0x27/0x100 kernel/acct.c:173 pin_kill+0x18f/0x860 fs/fs_pin.c:50 acct_on+0x574/0x790 kernel/acct.c:254 __do_sys_acct kernel/acct.c:286 [inline] __se_sys_acct kernel/acct.c:273 [inline] __x64_sys_acct+0xae/0x200 kernel/acct.c:273 do_syscall_64+0x103/0x670 arch/x86/entry/common.c:298 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (sb_writers#3){.+.+}: percpu_down_read include/linux/percpu-rwsem.h:36 [inline] __sb_start_write+0x20b/0x360 fs/super.c:1608 sb_start_write include/linux/fs.h:1621 [inline] mnt_want_write+0x3f/0xc0 fs/namespace.c:358 ovl_want_write+0x76/0xa0 fs/overlayfs/util.c:24 ovl_link+0x32/0x24f fs/overlayfs/dir.c:672 vfs_link+0x7a4/0xbc0 fs/namei.c:4239 do_linkat+0x550/0x770 fs/namei.c:4307 __do_sys_link fs/namei.c:4336 [inline] __se_sys_link fs/namei.c:4334 [inline] __x64_sys_link+0x61/0x80 fs/namei.c:4334 do_syscall_64+0x103/0x670 arch/x86/entry/common.c:298 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (&ovl_i_mutex_key[depth]){+.+.}: lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:4302 down_write+0x38/0xa0 kernel/locking/rwsem.c:66 inode_lock include/linux/fs.h:772 [inline] ovl_write_iter+0x148/0xc20 fs/overlayfs/file.c:231 call_write_iter include/linux/fs.h:1866 [inline] new_sync_write+0x4c7/0x760 fs/read_write.c:474 __vfs_write+0xe4/0x110 fs/read_write.c:487 __kernel_write+0x110/0x3b0 fs/read_write.c:506 do_acct_process+0xd37/0x1150 kernel/acct.c:520 slow_acct_process kernel/acct.c:579 [inline] acct_process+0x568/0x61e kernel/acct.c:605 do_exit+0x17bd/0x2fa0 kernel/exit.c:866 do_group_exit+0x135/0x370 kernel/exit.c:980 get_signal+0x399/0x1d50 kernel/signal.c:2577 do_signal+0x87/0x1900 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x244/0x2c0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:276 [inline] do_syscall_64+0x57e/0x670 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Chain exists of: &ovl_i_mutex_key[depth] --> sb_writers#3 --> &acct->lock#2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&acct->lock#2); lock(sb_writers#3); lock(&acct->lock#2); lock(&ovl_i_mutex_key[depth]); *** DEADLOCK *** 2 locks held by syz-executor.2/13282: #0: 00000000b7dd5e3c (&acct->lock#2){+.+.}, at: acct_get kernel/acct.c:161 [inline] #0: 00000000b7dd5e3c (&acct->lock#2){+.+.}, at: slow_acct_process kernel/acct.c:577 [inline] #0: 00000000b7dd5e3c (&acct->lock#2){+.+.}, at: acct_process+0x2e5/0x61e kernel/acct.c:605 #1: 00000000dd3c76bb (sb_writers#18){.+.+}, at: file_start_write_trylock include/linux/fs.h:2832 [inline] #1: 00000000dd3c76bb (sb_writers#18){.+.+}, at: do_acct_process+0xf37/0x1150 kernel/acct.c:517 stack backtrace: CPU: 1 PID: 13282 Comm: syz-executor.2 Not tainted 5.1.0+ #2 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+0x172/0x1f0 lib/dump_stack.c:113 print_circular_bug.cold+0x1cc/0x28f kernel/locking/lockdep.c:1564 check_prev_add kernel/locking/lockdep.c:2309 [inline] check_prevs_add kernel/locking/lockdep.c:2417 [inline] validate_chain kernel/locking/lockdep.c:2799 [inline] __lock_acquire+0x3755/0x5490 kernel/locking/lockdep.c:3792 lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:4302 down_write+0x38/0xa0 kernel/locking/rwsem.c:66 inode_lock include/linux/fs.h:772 [inline] ovl_write_iter+0x148/0xc20 fs/overlayfs/file.c:231 call_write_iter include/linux/fs.h:1866 [inline] new_sync_write+0x4c7/0x760 fs/read_write.c:474 __vfs_write+0xe4/0x110 fs/read_write.c:487 __kernel_write+0x110/0x3b0 fs/read_write.c:506 do_acct_process+0xd37/0x1150 kernel/acct.c:520 slow_acct_process kernel/acct.c:579 [inline] acct_process+0x568/0x61e kernel/acct.c:605 do_exit+0x17bd/0x2fa0 kernel/exit.c:866 do_group_exit+0x135/0x370 kernel/exit.c:980 get_signal+0x399/0x1d50 kernel/signal.c:2577 do_signal+0x87/0x1900 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x244/0x2c0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:276 [inline] do_syscall_64+0x57e/0x670 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x458da9 Code: 05 0c cc 45 00 48 89 04 24 48 c7 44 24 08 01 00 00 00 e8 6a 3e fd ff 48 8b 44 24 18 48 89 04 24 e8 0c 3d fd ff 48 8d 05 e5 cb <45> 00 48 89 04 24 48 c7 44 24 08 01 00 00 00 e8 43 3e fd ff 48 8b RSP: 002b:00007f641c011cf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 000000000073bfa8 RCX: 0000000000458da9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 000000000073bfa8 RBP: 000000000073bfa0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000073bfac R13: 00007ffc332e430f R14: 00007f641c0129c0 R15: 000000000073bfac