============================================ WARNING: possible recursive locking detected 6.1.119-syzkaller #0 Not tainted -------------------------------------------- syz.2.12/4437 is trying to acquire lock: ffff88802713dd28 (&sbi->s_alloc_mutex){+.+.}-{3:3}, at: udf_table_free_blocks fs/udf/balloc.c:395 [inline] ffff88802713dd28 (&sbi->s_alloc_mutex){+.+.}-{3:3}, at: udf_free_blocks+0x9ad/0x21e0 fs/udf/balloc.c:686 but task is already holding lock: ffff88802713dd28 (&sbi->s_alloc_mutex){+.+.}-{3:3}, at: udf_table_new_block fs/udf/balloc.c:594 [inline] ffff88802713dd28 (&sbi->s_alloc_mutex){+.+.}-{3:3}, at: udf_new_block+0xf84/0x2130 fs/udf/balloc.c:734 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&sbi->s_alloc_mutex); lock(&sbi->s_alloc_mutex); *** DEADLOCK *** May be due to missing lock nesting notation 4 locks held by syz.2.12/4437: #0: ffff88805656a460 (sb_writers#16){.+.+}-{0:0}, at: do_sendfile+0x5f4/0xff0 fs/read_write.c:1254 #1: ffff888074bd8f78 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff888074bd8f78 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: udf_file_write_iter+0x75/0x670 fs/udf/file.c:145 #2: ffff888074bd8da0 (&ei->i_data_sem#2){++++}-{3:3}, at: udf_get_block+0x153/0x5360 fs/udf/inode.c:346 #3: ffff88802713dd28 (&sbi->s_alloc_mutex){+.+.}-{3:3}, at: udf_table_new_block fs/udf/balloc.c:594 [inline] #3: ffff88802713dd28 (&sbi->s_alloc_mutex){+.+.}-{3:3}, at: udf_new_block+0xf84/0x2130 fs/udf/balloc.c:734 stack backtrace: CPU: 1 PID: 4437 Comm: syz.2.12 Not tainted 6.1.119-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2983 [inline] check_deadlock kernel/locking/lockdep.c:3026 [inline] validate_chain+0x4711/0x5950 kernel/locking/lockdep.c:3812 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747 udf_table_free_blocks fs/udf/balloc.c:395 [inline] udf_free_blocks+0x9ad/0x21e0 fs/udf/balloc.c:686 udf_delete_aext+0x68a/0xda0 fs/udf/inode.c:2211 udf_table_new_block fs/udf/balloc.c:654 [inline] udf_new_block+0x184d/0x2130 fs/udf/balloc.c:734 inode_getblk fs/udf/inode.c:769 [inline] udf_get_block+0x1a69/0x5360 fs/udf/inode.c:359 __block_write_begin_int+0x544/0x1a30 fs/buffer.c:1991 __block_write_begin fs/buffer.c:2041 [inline] block_write_begin+0x98/0x1f0 fs/buffer.c:2102 udf_write_begin+0x2d/0x60 fs/udf/inode.c:212 generic_perform_write+0x2fc/0x5e0 mm/filemap.c:3845 __generic_file_write_iter+0x297/0x400 mm/filemap.c:3941 udf_file_write_iter+0x291/0x670 fs/udf/file.c:164 do_iter_write+0x6e6/0xc40 fs/read_write.c:861 iter_file_splice_write+0x830/0xfc0 fs/splice.c:685 do_splice_from fs/splice.c:763 [inline] direct_splice_actor+0xe3/0x1c0 fs/splice.c:950 splice_direct_to_actor+0x4c7/0xc30 fs/splice.c:896 do_splice_direct+0x2a5/0x3e0 fs/splice.c:1002 do_sendfile+0x619/0xff0 fs/read_write.c:1255 __do_sys_sendfile64 fs/read_write.c:1323 [inline] __se_sys_sendfile64+0x178/0x1e0 fs/read_write.c:1309 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f8e8cf7ff19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f8e8de59058 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f8e8d145fa0 RCX: 00007f8e8cf7ff19 RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000005 RBP: 00007f8e8cff3986 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000800000009 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f8e8d145fa0 R15: 00007fff16a37b98