EXT4-fs: Ignoring removed oldalloc option EXT4-fs (loop7): 1 truncate cleaned up EXT4-fs (loop7): mounted filesystem without journal. Quota mode: writeback. ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.7.2691/16230 is trying to acquire lock: ffff8880736e6460 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:402 but task is already holding lock: ffff888025010128 (&common->filesem){+.+.}-{3:3}, at: fsg_store_file+0x174/0x530 drivers/usb/gadget/function/storage_common.c:451 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&common->filesem){+.+.}-{3:3}: down_write+0x36/0x60 kernel/locking/rwsem.c:1573 fsg_store_file+0x174/0x530 drivers/usb/gadget/function/storage_common.c:451 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 (&p->frag_sem){.+.+}-{3:3}: down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520 fill_read_buffer fs/configfs/file.c:66 [inline] configfs_read_iter+0x19e/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:3834 do_filp_open+0x1ee/0x420 fs/namei.c:3861 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 (&buffer->mutex){+.+.}-{3:3} : __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12d/0xae0 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:3834 do_filp_open+0x1ee/0x420 fs/namei.c:3861 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 -> #1 (&iint_mutex_key[depth]){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12d/0xae0 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:3834 do_filp_open+0x1ee/0x420 fs/namei.c:3861 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 (sb_writers#4){.+.+}-{0:0}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3830 [inline] __lock_acquire+0x2d18/0x7c40 kernel/locking/lockdep.c:5063 lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5678 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 open_last_lookups fs/namei.c:3590 [inline] path_openat+0x75c/0x2f10 fs/namei.c:3831 do_filp_open+0x1ee/0x420 fs/namei.c:3861 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 other info that might help us debug this: Chain exists of: sb_writers#4 --> &p->frag_sem --> &common->filesem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&common->filesem); lock(&p->frag_sem); lock(&common->filesem); lock(sb_writers#4); *** DEADLOCK *** 5 locks held by syz.7.2691/16230: #0: ffff88807c0ea368 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x2ae/0x360 fs/file.c:1038 #1: ffff888019b32460 (sb_writers#14){.+.+}-{0:0}, at: vfs_write+0x270/0x9a0 fs/read_write.c:580 #2: ffff88807c834688 (&buffer->mutex){+.+.}-{3:3}, at: configfs_write_iter+0x7d/0x400 fs/configfs/file.c:226 #3: ffff88801e655078 (&p->frag_sem){.+.+}-{3:3}, at: flush_write_buffer fs/configfs/file.c:205 [inline] #3: ffff88801e655078 (&p->frag_sem){.+.+}-{3:3}, at: configfs_write_iter+0x20e/0x400 fs/configfs/file.c:229 #4: ffff888025010128 (&common->filesem){+.+.}-{3:3}, at: fsg_store_file+0x174/0x530 drivers/usb/gadget/function/storage_common.c:451 stack backtrace: CPU: 1 PID: 16230 Comm: syz.7.2691 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106 check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3830 [inline] __lock_acquire+0x2d18/0x7c40 kernel/locking/lockdep.c:5063 lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5678 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 open_last_lookups fs/namei.c:3590 [inline] path_openat+0x75c/0x2f10 fs/namei.c:3831 do_filp_open+0x1ee/0x420 fs/namei.c:3861 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 RIP: 0033:0x7fa66079e159 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:00007fa661728028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fa660a25fa0 RCX: 00007fa66079e159 RDX: 0000000000000001 RSI: 00002000000003c0 RDI: 0000000000000003 RBP: 00007fa66083506b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fa660a26038 R14: 00007fa660a25fa0 R15: 00007ffd9c09a9f8 mass_storage.0/lun.0: unable to open backing file: f