bisecting fixing commit since 1590a2e1c681b0991bd42c992cabfd380e0338f2 building syzkaller on ffec44b5d1e024359410f6ba8d5e965973ede8f5 testing commit 1590a2e1c681b0991bd42c992cabfd380e0338f2 with gcc (GCC) 8.1.0 kernel signature: b2a4bf59cfa5b8e7db5b32b96dc52c37048bee600119fdac6f88f0f3bc62dda5 all runs: crashed: possible deadlock in process_measurement testing current HEAD 15bc20c6af4ceee97a1f90b43c0e386643c071b4 testing commit 15bc20c6af4ceee97a1f90b43c0e386643c071b4 with gcc (GCC) 8.1.0 kernel signature: c096aaf1da0d5852c02d5c0e42bff5270e338cec0ed41d4e7a650cad74c471fc all runs: crashed: possible deadlock in process_measurement revisions tested: 2, total time: 17m9.490207329s (build: 10m28.840131452s, test: 6m7.273738369s) the crash still happens on HEAD commit msg: Merge tag 'tty-5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty crash: possible deadlock in process_measurement ====================================================== WARNING: possible circular locking dependency detected 5.9.0-rc2-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/8489 is trying to acquire lock: ffff88810e6f9780 (&iint->mutex){+.+.}-{3:3}, at: process_measurement+0x155/0x920 security/integrity/ima/ima_main.c:247 but task is already holding lock: ffff888217215450 (sb_writers#4){.+.+}-{0:0}, at: sb_start_write include/linux/fs.h:1643 [inline] ffff888217215450 (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+0x13a/0x270 fs/super.c:1672 sb_start_write include/linux/fs.h:1643 [inline] mnt_want_write+0x1b/0x50 fs/namespace.c:354 ovl_maybe_copy_up+0x6a/0x90 fs/overlayfs/copy_up.c:961 ovl_open+0x23/0x80 fs/overlayfs/file.c:147 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:324 ima_file_check+0x60/0x90 security/integrity/ima/ima_main.c:492 do_open fs/namei.c:3253 [inline] path_openat+0x493/0xa90 fs/namei.c:3368 do_filp_open+0x8e/0x100 fs/namei.c:3395 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:2496 [inline] check_prevs_add kernel/locking/lockdep.c:2601 [inline] validate_chain kernel/locking/lockdep.c:3218 [inline] __lock_acquire+0x1056/0x16c0 kernel/locking/lockdep.c:4426 lock_acquire+0xd0/0x3e0 kernel/locking/lockdep.c:5005 __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:247 ima_file_check+0x60/0x90 security/integrity/ima/ima_main.c:492 do_open fs/namei.c:3253 [inline] path_openat+0x493/0xa90 fs/namei.c:3368 do_filp_open+0x8e/0x100 fs/namei.c:3395 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.0/8489: #0: ffff888217215450 (sb_writers#4){.+.+}-{0:0}, at: sb_start_write include/linux/fs.h:1643 [inline] #0: ffff888217215450 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x1b/0x50 fs/namespace.c:354 stack backtrace: CPU: 0 PID: 8489 Comm: syz-executor.0 Not tainted 5.9.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+0xb3/0xec lib/dump_stack.c:118 check_noncircular+0x165/0x180 kernel/locking/lockdep.c:1827 check_prev_add kernel/locking/lockdep.c:2496 [inline] check_prevs_add kernel/locking/lockdep.c:2601 [inline] validate_chain kernel/locking/lockdep.c:3218 [inline] __lock_acquire+0x1056/0x16c0 kernel/locking/lockdep.c:4426 lock_acquire+0xd0/0x3e0 kernel/locking/lockdep.c:5005 __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:247 ima_file_check+0x60/0x90 security/integrity/ima/ima_main.c:492 do_open fs/namei.c:3253 [inline] path_openat+0x493/0xa90 fs/namei.c:3368 do_filp_open+0x8e/0x100 fs/namei.c:3395 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:00007fec5d593c78 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: 00007fec5d5946d4