UDF-fs: INFO Mounting volume 'LiuxUDF', timestamp 2022/11/22 14:59 (1000) ============================================ WARNING: possible recursive locking detected 6.6.0-rc1-syzkaller #0 Not tainted -------------------------------------------- syz.1.26/5033 is trying to acquire lock: ffff88811f1d2528 (&sbi->s_alloc_mutex){+.+.}-{4:4}, at: udf_table_free_blocks fs/udf/balloc.c:391 [inline] ffff88811f1d2528 (&sbi->s_alloc_mutex){+.+.}-{4:4}, at: udf_free_blocks+0xd4/0x6f0 fs/udf/balloc.c:681 but task is already holding lock: ffff88811f1d2528 (&sbi->s_alloc_mutex){+.+.}-{4:4}, at: udf_table_new_block fs/udf/balloc.c:600 [inline] ffff88811f1d2528 (&sbi->s_alloc_mutex){+.+.}-{4:4}, at: udf_new_block+0x4b0/0x7e0 fs/udf/balloc.c:729 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.1.26/5033: #0: ffff88810eb0c410 (sb_writers#13){.+.+}-{0:0}, at: do_sendfile+0x276/0x470 fs/read_write.c:1253 #1: ffff88810fea3e08 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:802 [inline] #1: ffff88810fea3e08 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: udf_file_write_iter+0x2d/0x190 fs/udf/file.c:95 #2: ffff88810fea3c30 (&ei->i_data_sem#2){++++}-{4:4}, at: udf_map_block+0x136/0x1780 fs/udf/inode.c:436 #3: ffff88811f1d2528 (&sbi->s_alloc_mutex){+.+.}-{4:4}, at: udf_table_new_block fs/udf/balloc.c:600 [inline] #3: ffff88811f1d2528 (&sbi->s_alloc_mutex){+.+.}-{4:4}, at: udf_new_block+0x4b0/0x7e0 fs/udf/balloc.c:729 stack backtrace: CPU: 0 PID: 5033 Comm: syz.1.26 Not tainted 6.6.0-rc1-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+0x8d/0xe0 lib/dump_stack.c:106 check_deadlock kernel/locking/lockdep.c:3062 [inline] validate_chain kernel/locking/lockdep.c:3855 [inline] __lock_acquire+0x1101/0x24d0 kernel/locking/lockdep.c:5136 lock_acquire+0xea/0x270 kernel/locking/lockdep.c:5753 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x99/0x9a0 kernel/locking/mutex.c:747 udf_table_free_blocks fs/udf/balloc.c:391 [inline] udf_free_blocks+0xd4/0x6f0 fs/udf/balloc.c:681 udf_delete_aext+0x18e/0x300 fs/udf/inode.c:2313 udf_table_new_block fs/udf/balloc.c:660 [inline] udf_new_block+0x65c/0x7e0 fs/udf/balloc.c:729 inode_getblk fs/udf/inode.c:874 [inline] udf_map_block+0x802/0x1780 fs/udf/inode.c:444 __udf_get_block fs/udf/inode.c:458 [inline] udf_get_block+0x5c/0xd0 fs/udf/inode.c:482 __block_write_begin_int+0x184/0x7e0 fs/buffer.c:2107 __block_write_begin fs/buffer.c:2157 [inline] block_write_begin+0x49/0xb0 fs/buffer.c:2216 udf_write_begin+0x108/0x200 fs/udf/inode.c:261 generic_perform_write+0xa9/0x250 mm/filemap.c:3942 __generic_file_write_iter+0x8e/0xb0 mm/filemap.c:4034 udf_file_write_iter+0xd6/0x190 fs/udf/file.c:111 do_iter_write+0x1ef/0x310 fs/read_write.c:860 iter_file_splice_write+0x27f/0x440 fs/splice.c:736 do_splice_from fs/splice.c:933 [inline] direct_splice_actor+0x2f/0xa0 fs/splice.c:1142 splice_direct_to_actor+0xd0/0x260 fs/splice.c:1088 do_splice_direct+0x92/0xe0 fs/splice.c:1194 do_sendfile+0x291/0x470 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64+0xab/0xe0 fs/read_write.c:1308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x46/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x6f/0xd9 RIP: 0033:0x7f954537ff19 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:00007f95460dd058 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f9545545fa0 RCX: 00007f954537ff19 RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000005 RBP: 00007f95453f3986 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000800000009 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f9545545fa0 R15: 00007ffc666cb9d8