bisecting fixing commit since 1590a2e1c681b0991bd42c992cabfd380e0338f2 building syzkaller on ffec44b5d1e024359410f6ba8d5e965973ede8f5 testing commit 1590a2e1c681b0991bd42c992cabfd380e0338f2 with gcc (GCC) 8.1.0 kernel signature: 0610804b1f77720550235c549497f70d779aba8d16d4a6122ea7fc138d613b91 all runs: crashed: possible deadlock in process_measurement testing current HEAD 4ef8451b332662d004df269d4cdeb7d9f31419b5 testing commit 4ef8451b332662d004df269d4cdeb7d9f31419b5 with gcc (GCC) 8.1.0 kernel signature: beb72cf91b6967e8c1db8c93496624b1850fef93f3929457be84cd4fe29b0f7c all runs: crashed: possible deadlock in process_measurement revisions tested: 2, total time: 17m14.846829121s (build: 10m33.002241448s, test: 5m59.787164763s) the crash still happens on HEAD commit msg: Merge tag 'perf-tools-for-v5.10-2020-11-03' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux crash: possible deadlock in process_measurement ====================================================== WARNING: possible circular locking dependency detected 5.10.0-rc2-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/8740 is trying to acquire lock: ffff88811e359860 (&iint->mutex){+.+.}-{3:3}, at: process_measurement+0x155/0x920 security/integrity/ima/ima_main.c:253 but task is already holding lock: ffff888100ef9460 (sb_writers#4){.+.+}-{0:0}, at: sb_start_write include/linux/fs.h:1648 [inline] ffff888100ef9460 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x1b/0x50 fs/namespace.c:354 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (sb_writers#4){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write+0x12e/0x260 fs/super.c:1674 sb_start_write include/linux/fs.h:1648 [inline] mnt_want_write+0x1b/0x50 fs/namespace.c:354 ovl_maybe_copy_up+0x6a/0x90 fs/overlayfs/copy_up.c:990 ovl_open+0x23/0x80 fs/overlayfs/file.c:154 do_dentry_open+0x15a/0x3c0 fs/open.c:817 vfs_open fs/open.c:931 [inline] dentry_open+0x69/0xa0 fs/open.c:947 ima_calc_file_hash+0xf7/0x190 security/integrity/ima/ima_crypto.c:557 ima_collect_measurement+0x1c8/0x1f0 security/integrity/ima/ima_api.c:250 process_measurement+0x503/0x920 security/integrity/ima/ima_main.c:330 ima_file_check+0x60/0x90 security/integrity/ima/ima_main.c:498 do_open fs/namei.c:3254 [inline] path_openat+0x493/0xa90 fs/namei.c:3369 do_filp_open+0x8e/0x100 fs/namei.c:3396 do_sys_openat2+0x219/0x2d0 fs/open.c:1168 do_sys_open+0x46/0x80 fs/open.c:1184 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #0 (&iint->mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:2864 [inline] check_prevs_add kernel/locking/lockdep.c:2989 [inline] validate_chain kernel/locking/lockdep.c:3607 [inline] __lock_acquire+0x1065/0x1770 kernel/locking/lockdep.c:4831 lock_acquire+0xf9/0x420 kernel/locking/lockdep.c:5436 __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x94/0x9f0 kernel/locking/mutex.c:1103 process_measurement+0x155/0x920 security/integrity/ima/ima_main.c:253 ima_file_check+0x60/0x90 security/integrity/ima/ima_main.c:498 do_open fs/namei.c:3254 [inline] path_openat+0x493/0xa90 fs/namei.c:3369 do_filp_open+0xd1/0x100 fs/namei.c:3398 do_sys_openat2+0x219/0x2d0 fs/open.c:1168 do_sys_open+0x46/0x80 fs/open.c:1184 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(sb_writers#4); lock(&iint->mutex); lock(sb_writers#4); lock(&iint->mutex); *** DEADLOCK *** 1 lock held by syz-executor.1/8740: #0: ffff888100ef9460 (sb_writers#4){.+.+}-{0:0}, at: sb_start_write include/linux/fs.h:1648 [inline] #0: ffff888100ef9460 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x1b/0x50 fs/namespace.c:354 stack backtrace: CPU: 0 PID: 8740 Comm: syz-executor.1 Not tainted 5.10.0-rc2-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+0xa3/0xc8 lib/dump_stack.c:118 check_noncircular+0xfe/0x110 kernel/locking/lockdep.c:2115 check_prev_add kernel/locking/lockdep.c:2864 [inline] check_prevs_add kernel/locking/lockdep.c:2989 [inline] validate_chain kernel/locking/lockdep.c:3607 [inline] __lock_acquire+0x1065/0x1770 kernel/locking/lockdep.c:4831 lock_acquire+0xf9/0x420 kernel/locking/lockdep.c:5436 __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x94/0x9f0 kernel/locking/mutex.c:1103 process_measurement+0x155/0x920 security/integrity/ima/ima_main.c:253 ima_file_check+0x60/0x90 security/integrity/ima/ima_main.c:498 do_open fs/namei.c:3254 [inline] path_openat+0x493/0xa90 fs/namei.c:3369 do_filp_open+0xd1/0x100 fs/namei.c:3398 do_sys_openat2+0x219/0x2d0 fs/open.c:1168 do_sys_open+0x46/0x80 fs/open.c:1184 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45cb99 Code: 8d b6 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 5b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ffbcdb02c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00000000004f8380 RCX: 000000000045cb99 RDX: 000000000000275a RSI: 00000000200001c0 RDI: ffffffffffffff9c RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000007b4 R14: 00000000004caa8a R15: 00007ffbcdb036d4