====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.4.3045/17029 is trying to acquire lock: ffff888056d45d38 (&iint_mutex_key[depth]){+.+.}-{3:3}, at: process_measurement+0x717/0x1c40 security/integrity/ima/ima_main.c:261 but task is already holding lock: ffff8880242f4460 (sb_writers#24 ){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:402 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #5 (sb_writers#24){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1897 [inline] sb_start_write+0x4d/0x1c0 include/linux/fs.h:1972 mnt_want_write+0x3d/0x90 fs/namespace.c:402 ovl_do_remove+0x1a2/0xa80 fs/overlayfs/dir.c:907 vfs_unlink+0x376/0x600 fs/namei.c:4377 do_unlinkat+0x335/0x580 fs/namei.c:4445 __do_sys_unlink fs/namei.c:4493 [inline] __se_sys_unlink fs/namei.c:4491 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4491 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #4 (&ovl_i_mutex_key[depth] ){+.+.}-{3:3} : down_write+0x36/0x60 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:764 [inline] process_measurement+0x3af/0x1c40 security/integrity/ima/ima_main.c:242 ima_file_check+0xc8/0x110 security/integrity/ima/ima_main.c:534 do_open fs/namei.c:3679 [inline] path_openat+0x272b/0x2f10 fs/namei.c:3838 do_filp_open+0x1ee/0x420 fs/namei.c:3865 file_open_name fs/open.c:1265 [inline] filp_open+0x17c/0x1e0 fs/open.c:1285 fsg_lun_open+0x63/0xf00 drivers/usb/gadget/function/storage_common.c:193 fsg_store_file+0x1a5/0x530 drivers/usb/gadget/function/storage_common.c:454 flush_write_buffer fs/configfs/file.c:207 [inline] configfs_write_iter+0x30b/0x400 fs/configfs/file.c:229 call_write_iter include/linux/fs.h:2271 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x482/0x9a0 fs/read_write.c:584 ksys_write+0x14d/0x260 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #3 (&common->filesem){++++}-{3:3}: down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520 fsg_show_file+0x29/0x130 drivers/usb/gadget/function/storage_common.c:338 fill_read_buffer fs/configfs/file.c:68 [inline] configfs_read_iter+0x296/0x560 fs/configfs/file.c:88 __kernel_read+0x2dd/0x6e0 fs/read_write.c:428 integrity_kernel_read+0x86/0xd0 security/integrity/iint.c:228 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+0xb12/0x1950 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x503/0xb50 security/integrity/ima/ima_api.c:293 process_measurement+0x119b/0x1c40 security/integrity/ima/ima_main.c:351 ima_file_check+0xc8/0x110 security/integrity/ima/ima_main.c:534 do_open fs/namei.c:3679 [inline] path_openat+0x272b/0x2f10 fs/namei.c:3838 do_filp_open+0x1ee/0x420 fs/namei.c:3865 do_sys_openat2+0x14b/0x4f0 fs/open.c:1320 do_sys_open fs/open.c:1336 [inline] __do_sys_openat fs/open.c:1352 [inline] __se_sys_openat fs/open.c:1347 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1347 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #2 (&p->frag_sem ){.+.+}-{3:3}: down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520 flush_write_buffer fs/configfs/file.c:205 [inline] configfs_write_iter+0x20e/0x400 fs/configfs/file.c:229 call_write_iter include/linux/fs.h:2271 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x482/0x9a0 fs/read_write.c:584 ksys_write+0x14d/0x260 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #1 (&buffer->mutex){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12d/0xb40 kernel/locking/mutex.c:747 configfs_read_iter+0x6e/0x560 fs/configfs/file.c:86 __kernel_read+0x2dd/0x6e0 fs/read_write.c:428 integrity_kernel_read+0x86/0xd0 security/integrity/iint.c:228 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+0xb12/0x1950 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x503/0xb50 security/integrity/ima/ima_api.c:293 process_measurement+0x119b/0x1c40 security/integrity/ima/ima_main.c:351 ima_file_check+0xc8/0x110 security/integrity/ima/ima_main.c:534 do_open fs/namei.c:3679 [inline] path_openat+0x272b/0x2f10 fs/namei.c:3838 do_filp_open+0x1ee/0x420 fs/namei.c:3865 do_sys_openat2+0x14b/0x4f0 fs/open.c:1320 do_sys_open fs/open.c:1336 [inline] __do_sys_openat fs/open.c:1352 [inline] __se_sys_openat fs/open.c:1347 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1347 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&iint_mutex_key[depth]){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3162 [inline] check_prevs_add kernel/locking/lockdep.c:3281 [inline] validate_chain kernel/locking/lockdep.c:3897 [inline] __lock_acquire+0x3a03/0x7ea0 kernel/locking/lockdep.c:5171 lock_acquire+0x1bc/0x4a0 kernel/locking/lockdep.c:5790 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12d/0xb40 kernel/locking/mutex.c:747 process_measurement+0x717/0x1c40 security/integrity/ima/ima_main.c:261 ima_file_check+0xc8/0x110 security/integrity/ima/ima_main.c:534 do_open fs/namei.c:3679 [inline] path_openat+0x272b/0x2f10 fs/namei.c:3838 do_filp_open+0x1ee/0x420 fs/namei.c:3865 do_sys_openat2+0x14b/0x4f0 fs/open.c:1320 do_sys_open fs/open.c:1336 [inline] __do_sys_open fs/open.c:1344 [inline] __se_sys_open fs/open.c:1340 [inline] __x64_sys_open+0x11b/0x140 fs/open.c:1340 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Chain exists of: &iint_mutex_key[depth] --> &ovl_i_mutex_key[depth] --> sb_writers#24 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_writers#24); lock(&ovl_i_mutex_key[depth]); lock(sb_writers#24); lock(&iint_mutex_key[depth]); *** DEADLOCK *** 1 lock held by syz.4.3045/17029: #0: ffff8880242f4460 (sb_writers#24){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:402 stack backtrace: CPU: 1 PID: 17029 Comm: syz.4.3045 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106 check_noncircular+0x2f8/0x400 kernel/locking/lockdep.c:2215 check_prev_add kernel/locking/lockdep.c:3162 [inline] check_prevs_add kernel/locking/lockdep.c:3281 [inline] validate_chain kernel/locking/lockdep.c:3897 [inline] __lock_acquire+0x3a03/0x7ea0 kernel/locking/lockdep.c:5171 lock_acquire+0x1bc/0x4a0 kernel/locking/lockdep.c:5790 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12d/0xb40 kernel/locking/mutex.c:747 process_measurement+0x717/0x1c40 security/integrity/ima/ima_main.c:261 ima_file_check+0xc8/0x110 security/integrity/ima/ima_main.c:534 do_open fs/namei.c:3679 [inline] path_openat+0x272b/0x2f10 fs/namei.c:3838 do_filp_open+0x1ee/0x420 fs/namei.c:3865 do_sys_openat2+0x14b/0x4f0 fs/open.c:1320 do_sys_open fs/open.c:1336 [inline] __do_sys_open fs/open.c:1344 [inline] __se_sys_open fs/open.c:1340 [inline] __x64_sys_open+0x11b/0x140 fs/open.c:1340 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fb502ba94d9 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:00007fb503a59028 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007fb502e26090 RCX: 00007fb502ba94d9 RDX: 0000000000000000 RSI: 000000000014927e RDI: 0000200000000180 RBP: 00007fb502c3804e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fb502e26128 R14: 00007fb502e26090 R15: 00007ffd41476168 kcov: kcov_task_exit: t = ffff888028fd8000, kcov->t = ffff888028fd8000