syz.6.495: attempt to access beyond end of device loop6: rw=8423425, sector=59, nr_sectors = 8 limit=64 ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.6.495/9437 is trying to acquire lock: ffff8880348060a0 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfs_find_init+0x18d/0x300 fs/hfs/bfind.c:-1 but task is already holding lock: ffff88804327a798 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_extend_file+0xf9/0x1680 fs/hfs/extent.c:397 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}: __mutex_lock_common kernel/locking/rtmutex_api.c:559 [inline] mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:578 hfs_extend_file+0xf9/0x1680 fs/hfs/extent.c:397 hfs_bmap_reserve+0x108/0x430 fs/hfs/btree.c:399 __hfs_ext_write_extent+0x1fc/0x470 fs/hfs/extent.c:121 __hfs_ext_cache_extent+0x6e/0x9b0 fs/hfs/extent.c:174 hfs_file_truncate+0x4e6/0xb70 fs/hfs/extent.c:527 hfs_file_release+0xc5/0x100 fs/hfs/inode.c:636 __fput+0x42a/0xa80 fs/file_table.c:512 task_work_run+0x1d9/0x270 kernel/task_work.c:233 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0x73a/0x2360 kernel/exit.c:1008 do_group_exit+0x22d/0x2f0 kernel/exit.c:1151 get_signal+0x121b/0x12c0 kernel/signal.c:3039 arch_do_signal_or_restart+0xbb/0x860 arch/x86/kernel/signal.c:337 __exit_to_user_mode_loop kernel/entry/common.c:66 [inline] exit_to_user_mode_loop+0x10e/0x770 kernel/entry/common.c:101 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:336 [inline] do_syscall_64+0x328/0x520 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&tree->tree_lock/1){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3181 [inline] check_prevs_add kernel/locking/lockdep.c:3300 [inline] validate_chain kernel/locking/lockdep.c:3924 [inline] __lock_acquire+0x15ff/0x2e40 kernel/locking/lockdep.c:5254 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5908 __mutex_lock_common kernel/locking/rtmutex_api.c:559 [inline] mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:578 hfs_find_init+0x18d/0x300 fs/hfs/bfind.c:-1 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_extend_file+0x367/0x1680 fs/hfs/extent.c:401 hfs_bmap_reserve+0x108/0x430 fs/hfs/btree.c:399 hfs_cat_create+0x23d/0x870 fs/hfs/catalog.c:104 hfs_mkdir+0x73/0xe0 fs/hfs/dir.c:226 vfs_mkdir+0x408/0x620 fs/namei.c:5410 filename_mkdirat+0x289/0x520 fs/namei.c:5443 __do_sys_mkdirat fs/namei.c:5464 [inline] __se_sys_mkdirat+0x35/0x150 fs/namei.c:5461 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 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&HFS_I(tree->inode)->extents_lock); lock(&tree->tree_lock/1); lock(&HFS_I(tree->inode)->extents_lock); lock(&tree->tree_lock/1); *** DEADLOCK *** locks held by syz.6.495/9437: 4, last CPU#1: #0: ffff88802a010510 (sb_writers#15){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:494 #1: ffff88804327a2f0 (&type->i_mutex_dir_key#10/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1069 [inline] #1: ffff88804327a2f0 (&type->i_mutex_dir_key#10/1){+.+.}-{4:4}, at: __start_dirop fs/namei.c:2918 [inline] #1: ffff88804327a2f0 (&type->i_mutex_dir_key#10/1){+.+.}-{4:4}, at: start_dirop fs/namei.c:2942 [inline] #1: ffff88804327a2f0 (&type->i_mutex_dir_key#10/1){+.+.}-{4:4}, at: filename_create+0x200/0x370 fs/namei.c:5092 #2: ffff88802884a0a0 (&tree->tree_lock){+.+.}-{4:4}, at: hfs_find_init+0x18d/0x300 fs/hfs/bfind.c:-1 #3: ffff88804327a798 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_extend_file+0xf9/0x1680 fs/hfs/extent.c:397 stack backtrace: CPU: 1 UID: 0 PID: 9437 Comm: syz.6.495 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e2/0x300 kernel/locking/lockdep.c:2059 check_noncircular+0x12f/0x150 kernel/locking/lockdep.c:2191 check_prev_add kernel/locking/lockdep.c:3181 [inline] check_prevs_add kernel/locking/lockdep.c:3300 [inline] validate_chain kernel/locking/lockdep.c:3924 [inline] __lock_acquire+0x15ff/0x2e40 kernel/locking/lockdep.c:5254 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5908 __mutex_lock_common kernel/locking/rtmutex_api.c:559 [inline] mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:578 hfs_find_init+0x18d/0x300 fs/hfs/bfind.c:-1 hfs_ext_read_extent fs/hfs/extent.c:200 [inline] hfs_extend_file+0x367/0x1680 fs/hfs/extent.c:401 hfs_bmap_reserve+0x108/0x430 fs/hfs/btree.c:399 hfs_cat_create+0x23d/0x870 fs/hfs/catalog.c:104 hfs_mkdir+0x73/0xe0 fs/hfs/dir.c:226 vfs_mkdir+0x408/0x620 fs/namei.c:5410 filename_mkdirat+0x289/0x520 fs/namei.c:5443 __do_sys_mkdirat fs/namei.c:5464 [inline] __se_sys_mkdirat+0x35/0x150 fs/namei.c:5461 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:0x7f3434a9cfc7 Code: 00 66 90 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 db f7 ff ff 66 2e 0f 1f 84 00 00 00 00 00 90 b8 02 01 00 00 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:00007f3432cd4e58 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f3432cd4ee0 RCX: 00007f3434a9cfc7 RDX: 00000000000001ff RSI: 00002000000005c0 RDI: 00000000ffffff9c RBP: 0000200000000080 R08: 0000200000000140 R09: 0000000000000000 R10: 0000200000000080 R11: 0000000000000246 R12: 00002000000005c0 R13: 00007f3432cd4ea0 R14: 0000000000000000 R15: 0000000000000000 syz.6.495: attempt to access beyond end of device loop6: rw=2049, sector=266, nr_sectors = 32 limit=64