============================================ WARNING: possible recursive locking detected syzkaller #0 Not tainted -------------------------------------------- syz.0.0/5352 is trying to acquire lock: ffff8880333b0478 (sb_writers#12){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:531 but task is already holding lock: ffff8880333b0478 (sb_writers#12){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2765 [inline] ffff8880333b0478 (sb_writers#12){.+.+}-{0:0}, at: vfs_write+0x22b/0xba0 fs/read_write.c:663 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(sb_writers#12); lock(sb_writers#12); *** DEADLOCK *** May be due to missing lock nesting notation locks held by syz.0.0/5352: 5, on CPU#0: #0: ffff8880141e60f0 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x118/0x160 fs/file.c:1413 #1: ffff8880333b0478 (sb_writers#12){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2765 [inline] #1: ffff8880333b0478 (sb_writers#12){.+.+}-{0:0}, at: vfs_write+0x22b/0xba0 fs/read_write.c:663 #2: ffff888045d79080 (&buffer->mutex){+.+.}-{4:4}, at: configfs_write_iter+0x7e/0x430 fs/configfs/file.c:226 #3: ffff8880404d0070 (&p->frag_sem){.+.+}-{4:4}, at: flush_write_buffer fs/configfs/file.c:205 [inline] #3: ffff8880404d0070 (&p->frag_sem){.+.+}-{4:4}, at: configfs_write_iter+0x238/0x430 fs/configfs/file.c:229 #4: ffff888045c5b920 (&common->filesem){+.+.}-{4:4}, at: fsg_store_file+0x163/0x400 drivers/usb/gadget/function/storage_common.c:452 stack backtrace: CPU: 0 UID: 0 PID: 5352 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_deadlock_bug+0x27a/0x290 kernel/locking/lockdep.c:3085 check_deadlock kernel/locking/lockdep.c:3137 [inline] validate_chain kernel/locking/lockdep.c:3939 [inline] __lock_acquire+0x25db/0x2de0 kernel/locking/lockdep.c:5288 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942 percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline] percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline] __sb_start_write include/linux/fs/super.h:19 [inline] sb_start_write+0x48/0x1c0 include/linux/fs/super.h:125 mnt_want_write+0x41/0x90 fs/namespace.c:531 lookup_open+0x1f7/0x1ae0 fs/namei.c:4459 open_last_lookups fs/namei.c:4774 [inline] path_openat+0x70c/0x20f0 fs/namei.c:5013 do_file_open+0x23e/0x4a0 fs/namei.c:5045 file_open_name fs/open.c:1401 [inline] filp_open+0x16d/0x1d0 fs/open.c:1418 fsg_lun_open+0x6c/0xdf0 drivers/usb/gadget/function/storage_common.c:194 fsg_store_file+0x19e/0x400 drivers/usb/gadget/function/storage_common.c:455 flush_write_buffer fs/configfs/file.c:207 [inline] configfs_write_iter+0x337/0x430 fs/configfs/file.c:229 new_sync_write fs/read_write.c:575 [inline] vfs_write+0x612/0xba0 fs/read_write.c:667 ksys_write+0x150/0x270 fs/read_write.c:719 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x16a/0x530 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f59d29a8fd9 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:00007f59d38c9fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f59d2c26090 RCX: 00007f59d29a8fd9 RDX: 0000000000000005 RSI: 0000200000009d80 RDI: 0000000000000008 RBP: 00007f59d2a37fed R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f59d2c26128 R14: 00007f59d2c26090 R15: 00007ffe6082feb8 mass_storage.0/lun.0: unable to open backing file: file0