====================================================== WARNING: possible circular locking dependency detected 5.7.0-rc6-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.3/18556 is trying to acquire lock: ffff8880a8a0ace0 (&iint->mutex){+.+.}-{3:3}, at: process_measurement+0x362/0x1750 security/integrity/ima/ima_main.c:247 but task is already holding lock: ffff888214a62450 (sb_writers#3){.+.+}-{0:0}, at: sb_start_write include/linux/fs.h:1655 [inline] ffff888214a62450 (sb_writers#3){.+.+}-{0:0}, at: mnt_want_write+0x3a/0xb0 fs/namespace.c:354 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (sb_writers#3){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write+0x230/0x470 fs/super.c:1674 sb_start_write include/linux/fs.h:1655 [inline] mnt_want_write+0x3a/0xb0 fs/namespace.c:354 ovl_maybe_copy_up+0x120/0x190 fs/overlayfs/copy_up.c:960 ovl_open+0xba/0x270 fs/overlayfs/file.c:132 do_dentry_open+0x4ba/0x1290 fs/open.c:797 vfs_open fs/open.c:911 [inline] dentry_open+0x132/0x1d0 fs/open.c:927 ima_calc_file_hash+0x333/0x560 security/integrity/ima/ima_crypto.c:431 ima_collect_measurement+0x4ca/0x570 security/integrity/ima/ima_api.c:249 process_measurement+0xc79/0x1750 security/integrity/ima/ima_main.c:324 ima_file_check+0xb9/0x100 security/integrity/ima/ima_main.c:440 do_open fs/namei.c:3231 [inline] path_openat+0x1997/0x27d0 fs/namei.c:3346 do_filp_open+0x192/0x260 fs/namei.c:3373 do_sys_openat2+0x585/0x7d0 fs/open.c:1148 do_sys_open+0xc3/0x140 fs/open.c:1164 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 -> #0 (&iint->mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:2515 [inline] check_prevs_add kernel/locking/lockdep.c:2620 [inline] validate_chain kernel/locking/lockdep.c:3237 [inline] __lock_acquire+0x2ab1/0x4c50 kernel/locking/lockdep.c:4355 lock_acquire+0x1f2/0x8f0 kernel/locking/lockdep.c:4934 __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x156/0x13c0 kernel/locking/mutex.c:1103 process_measurement+0x362/0x1750 security/integrity/ima/ima_main.c:247 ima_file_check+0xb9/0x100 security/integrity/ima/ima_main.c:440 do_open fs/namei.c:3231 [inline] path_openat+0x1997/0x27d0 fs/namei.c:3346 do_filp_open+0x192/0x260 fs/namei.c:3373 do_sys_openat2+0x585/0x7d0 fs/open.c:1148 do_sys_open+0xc3/0x140 fs/open.c:1164 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(sb_writers#3); lock(&iint->mutex); lock(sb_writers#3); lock(&iint->mutex); *** DEADLOCK *** 1 lock held by syz-executor.3/18556: #0: ffff888214a62450 (sb_writers#3){.+.+}-{0:0}, at: sb_start_write include/linux/fs.h:1655 [inline] #0: ffff888214a62450 (sb_writers#3){.+.+}-{0:0}, at: mnt_want_write+0x3a/0xb0 fs/namespace.c:354 stack backtrace: CPU: 1 PID: 18556 Comm: syz-executor.3 Not tainted 5.7.0-rc6-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+0x188/0x20d lib/dump_stack.c:118 check_noncircular+0x32e/0x3e0 kernel/locking/lockdep.c:1846 check_prev_add kernel/locking/lockdep.c:2515 [inline] check_prevs_add kernel/locking/lockdep.c:2620 [inline] validate_chain kernel/locking/lockdep.c:3237 [inline] __lock_acquire+0x2ab1/0x4c50 kernel/locking/lockdep.c:4355 lock_acquire+0x1f2/0x8f0 kernel/locking/lockdep.c:4934 __mutex_lock_common kernel/locking/mutex.c:956 [inline] __mutex_lock+0x156/0x13c0 kernel/locking/mutex.c:1103 process_measurement+0x362/0x1750 security/integrity/ima/ima_main.c:247 ima_file_check+0xb9/0x100 security/integrity/ima/ima_main.c:440 do_open fs/namei.c:3231 [inline] path_openat+0x1997/0x27d0 fs/namei.c:3346 do_filp_open+0x192/0x260 fs/namei.c:3373 do_sys_openat2+0x585/0x7d0 fs/open.c:1148 do_sys_open+0xc3/0x140 fs/open.c:1164 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x45ca29 Code: 0d b7 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 db b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f6d2c2ebc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00000000004f6c80 RCX: 000000000045ca29 RDX: 0000000000000000 RSI: 000000000000ff00 RDI: 0000000020000300 RBP: 000000000078bfa0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000779 R14: 000000000052565f R15: 00007f6d2c2ec6d4 overlayfs: upperdir is in-use as upperdir/workdir of another mount, mount with '-o index=off' to override exclusive upperdir protection.