====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.2.3520/19323 is trying to acquire lock: ffff88806aa42418 (sb_writers#5){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:412 but task is already holding lock: ffff88805e53c170 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline] ffff88805e53c170 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: open_last_lookups fs/namei.c:3561 [inline] ffff88805e53c170 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: path_openat+0x7f4/0x3270 fs/namei.c:3798 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}: down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520 inode_lock_shared include/linux/fs.h:814 [inline] lookup_slow+0x46/0x70 fs/namei.c:1718 walk_component+0x2ad/0x3e0 fs/namei.c:2010 lookup_last fs/namei.c:2467 [inline] path_lookupat+0x148/0x420 fs/namei.c:2491 filename_lookup+0x22d/0x580 fs/namei.c:2520 kern_path+0x35/0x50 fs/namei.c:2618 lookup_bdev+0xc9/0x290 block/bdev.c:989 resume_store+0x170/0x4c0 kernel/power/hibernate.c:1187 kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352 call_write_iter include/linux/fs.h:2018 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x474/0x9a0 fs/read_write.c:584 ksys_write+0x151/0x260 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #2 (&of->mutex){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747 kernfs_file_read_iter fs/kernfs/file.c:258 [inline] kernfs_fop_read_iter+0x18e/0x680 fs/kernfs/file.c:298 __kernel_read+0x2e5/0x730 fs/read_write.c:428 integrity_kernel_read+0x8a/0xd0 security/integrity/iint.c:221 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:485 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline] ima_calc_file_hash+0xb1f/0x1960 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x4d4/0xa30 security/integrity/ima/ima_api.c:290 process_measurement+0x123a/0x1d50 security/integrity/ima/ima_main.c:370 ima_file_check+0xcc/0x110 security/integrity/ima/ima_main.c:568 do_open fs/namei.c:3642 [inline] path_openat+0x2910/0x3270 fs/namei.c:3801 do_filp_open+0x1f2/0x430 fs/namei.c:3828 do_sys_openat2+0x134/0x1d0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_openat fs/open.c:1453 [inline] __se_sys_openat fs/open.c:1448 [inline] __x64_sys_openat+0x139/0x160 fs/open.c:1448 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #1 (&iint_mutex_key[depth]){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747 process_measurement+0x739/0x1d50 security/integrity/ima/ima_main.c:275 ima_file_check+0xcc/0x110 security/integrity/ima/ima_main.c:568 do_open fs/namei.c:3642 [inline] path_openat+0x2910/0x3270 fs/namei.c:3801 do_filp_open+0x1f2/0x430 fs/namei.c:3828 do_sys_openat2+0x134/0x1d0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_openat fs/open.c:1453 [inline] __se_sys_openat fs/open.c:1448 [inline] __x64_sys_openat+0x139/0x160 fs/open.c:1448 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (sb_writers#5){.+.+}-{0:0}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x37ef/0x7d80 kernel/locking/lockdep.c:5137 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1633 [inline] sb_start_write+0x4d/0x1c0 include/linux/fs.h:1708 mnt_want_write+0x41/0x90 fs/namespace.c:412 ovl_create_object+0xb5/0x2a0 fs/overlayfs/dir.c:626 lookup_open fs/namei.c:3496 [inline] open_last_lookups fs/namei.c:3564 [inline] path_openat+0x1705/0x3270 fs/namei.c:3798 do_filp_open+0x1f2/0x430 fs/namei.c:3828 do_sys_openat2+0x134/0x1d0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_open fs/open.c:1445 [inline] __se_sys_open fs/open.c:1441 [inline] __x64_sys_open+0x11f/0x140 fs/open.c:1441 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Chain exists of: sb_writers#5 --> &of->mutex --> &ovl_i_mutex_dir_key[depth] Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ovl_i_mutex_dir_key[depth]); lock(&of->mutex); lock(&ovl_i_mutex_dir_key[depth]); rlock(sb_writers#5); *** DEADLOCK *** 2 locks held by syz.2.3520/19323: #0: ffff888065a4a418 (sb_writers#20){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:412 #1: ffff88805e53c170 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline] #1: ffff88805e53c170 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: open_last_lookups fs/namei.c:3561 [inline] #1: ffff88805e53c170 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: path_openat+0x7f4/0x3270 fs/namei.c:3798 stack backtrace: CPU: 1 PID: 19323 Comm: syz.2.3520 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106 check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x37ef/0x7d80 kernel/locking/lockdep.c:5137 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1633 [inline] sb_start_write+0x4d/0x1c0 include/linux/fs.h:1708 mnt_want_write+0x41/0x90 fs/namespace.c:412 ovl_create_object+0xb5/0x2a0 fs/overlayfs/dir.c:626 lookup_open fs/namei.c:3496 [inline] open_last_lookups fs/namei.c:3564 [inline] path_openat+0x1705/0x3270 fs/namei.c:3798 do_filp_open+0x1f2/0x430 fs/namei.c:3828 do_sys_openat2+0x134/0x1d0 fs/open.c:1422 do_sys_open fs/open.c:1437 [inline] __do_sys_open fs/open.c:1445 [inline] __se_sys_open fs/open.c:1441 [inline] __x64_sys_open+0x11f/0x140 fs/open.c:1441 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f18d7f9e019 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f18d8e78028 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007f18d8225fa0 RCX: 00007f18d7f9e019 RDX: 0000000000000080 RSI: 0000000000143142 RDI: 0000200000000000 RBP: 00007f18d803500c R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f18d8226038 R14: 00007f18d8225fa0 R15: 00007fffd4e9af48