syz.0.0: attempt to access beyond end of device loop0: rw=8388608, sector=25900, nr_sectors = 1 limit=64 Buffer I/O error on dev loop0, logical block 25900, async page read syz.0.0: attempt to access beyond end of device loop0: rw=8388608, sector=25901, nr_sectors = 1 limit=64 Buffer I/O error on dev loop0, logical block 25901, async page read syz.0.0: attempt to access beyond end of device loop0: rw=8388608, sector=26983, nr_sectors = 1 limit=64 Buffer I/O error on dev loop0, logical block 26983, async page read syz.0.0: attempt to access beyond end of device loop0: rw=8388608, sector=26984, nr_sectors = 1 limit=64 Buffer I/O error on dev loop0, logical block 26984, async page read syz.0.0: attempt to access beyond end of device loop0: rw=8388608, sector=26985, nr_sectors = 1 limit=64 Buffer I/O error on dev loop0, logical block 26985, async page read syz.0.0: attempt to access beyond end of device loop0: rw=8388608, sector=26986, nr_sectors = 1 limit=64 Buffer I/O error on dev loop0, logical block 26986, async page read syz.0.0: attempt to access beyond end of device loop0: rw=8388608, sector=25900, nr_sectors = 1 limit=64 Buffer I/O error on dev loop0, logical block 25900, async page read syz.0.0: attempt to access beyond end of device loop0: rw=8388608, sector=25901, nr_sectors = 1 limit=64 Buffer I/O error on dev loop0, logical block 25901, async page read syz.0.0: attempt to access beyond end of device loop0: rw=8388608, sector=26983, nr_sectors = 1 limit=64 Buffer I/O error on dev loop0, logical block 26983, async page read syz.0.0: attempt to access beyond end of device loop0: rw=8388608, sector=26984, nr_sectors = 1 limit=64 Buffer I/O error on dev loop0, logical block 26984, async page read ============================================ WARNING: possible recursive locking detected syzkaller #0 Not tainted -------------------------------------------- syz.0.0/5350 is trying to acquire lock: ffff88803857a0a8 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfs_find_init+0x18d/0x300 fs/hfs/bfind.c:-1 but task is already holding lock: ffff88803857a0a8 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfs_find_init+0x18d/0x300 fs/hfs/bfind.c:-1 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&tree->tree_lock/1); lock(&tree->tree_lock/1); *** DEADLOCK *** May be due to missing lock nesting notation locks held by syz.0.0/5350: 6, last CPU#0: #0: ffff8880138c60f0 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x118/0x160 fs/file.c:1408 #1: ffff888014a32460 (sb_writers#13){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2758 [inline] #1: ffff888014a32460 (sb_writers#13){.+.+}-{0:0}, at: vfs_write+0x22b/0xba0 fs/read_write.c:683 #2: ffff888013eef040 (&sb->s_type->i_mutex_key#25){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1024 [inline] #2: ffff888013eef040 (&sb->s_type->i_mutex_key#25){+.+.}-{4:4}, at: generic_file_write_iter+0x82/0x330 mm/filemap.c:4532 #3: ffff888013eeeea0 (&HFS_I(inode)->extents_lock){+.+.}-{4:4}, at: hfs_extend_file+0xf9/0x1680 fs/hfs/extent.c:403 #4: ffff88803857a0a8 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfs_find_init+0x18d/0x300 fs/hfs/bfind.c:-1 #5: ffff8880134180a0 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_extend_file+0xf9/0x1680 fs/hfs/extent.c:403 stack backtrace: CPU: 0 UID: 0 PID: 5350 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 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x197/0x15a0 kernel/locking/mutex.c:821 hfs_find_init+0x18d/0x300 fs/hfs/bfind.c:-1 hfs_ext_read_extent fs/hfs/extent.c:206 [inline] hfs_extend_file+0x367/0x1680 fs/hfs/extent.c:407 hfs_bmap_reserve+0x108/0x430 fs/hfs/btree.c:402 __hfs_ext_write_extent+0x200/0x620 fs/hfs/extent.c:121 __hfs_ext_cache_extent+0x6e/0x9b0 fs/hfs/extent.c:180 hfs_ext_read_extent fs/hfs/extent.c:208 [inline] hfs_extend_file+0x3ad/0x1680 fs/hfs/extent.c:407 hfs_get_block+0x401/0xbf0 fs/hfs/extent.c:359 __block_write_begin_int+0x6c1/0x1930 fs/buffer.c:2031 block_write_begin fs/buffer.c:2145 [inline] cont_write_begin+0x71b/0xac0 fs/buffer.c:2507 hfs_write_begin+0x123/0x1c0 fs/hfs/inode.c:62 generic_perform_write+0x2d5/0x8e0 mm/filemap.c:4392 generic_file_write_iter+0xae/0x330 mm/filemap.c:4535 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x612/0xba0 fs/read_write.c:687 ksys_write+0x150/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f8f9f39f559 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:00007f8fa029bfe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f8f9f625fa0 RCX: 00007f8f9f39f559 RDX: 00000000fffffdef RSI: 0000200000001b40 RDI: 0000000000000008 RBP: 00007f8f9f436b20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f8f9f626038 R14: 00007f8f9f625fa0 R15: 00007ffcff30ac28