syzbot


possible deadlock in hfsplus_file_extend

Status: upstream: reported C repro on 2025/10/16 15:40
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+118252a326fb17e89c6d@syzkaller.appspotmail.com
First crash: 9d00h, last: 9d00h
Bug presence (1)
Date Name Commit Repro Result
2025/10/18 upstream (ToT) d303caf5caf4 C [report] possible deadlock in hfsplus_file_extend
Similar bugs (10)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in hfsplus_file_extend (3) 4 4 3d12h 5d23h 0/3 upstream: reported on 2025/10/19 16:41
linux-6.1 possible deadlock in hfsplus_file_extend origin:upstream missing-backport 4 C done 2760 448d 957d 3/3 fixed on 2024/09/08 06:54
linux-5.15 possible deadlock in hfsplus_file_extend (3) 4 3 1d11h 4d08h 0/3 upstream: reported on 2025/10/21 07:38
upstream possible deadlock in hfsplus_file_extend (2) hfs 4 C inconclusive 493 2d01h 348d 0/29 upstream: reported C repro on 2024/11/11 11:50
linux-5.15 possible deadlock in hfsplus_file_extend (2) 4 7 326d 377d 0/3 auto-obsoleted due to no activity on 2025/03/13 03:31
linux-4.14 possible deadlock in hfsplus_file_extend hfsplus 4 C 3 965d 1031d 0/1 upstream: reported C repro on 2022/12/29 06:07
linux-5.15 possible deadlock in hfsplus_file_extend missing-backport origin:lts-only 4 C done 3439 432d 958d 3/3 fixed on 2024/09/23 09:27
linux-4.19 possible deadlock in hfsplus_file_extend hfsplus 4 C 258 964d 1064d 0/1 upstream: reported C repro on 2022/11/26 10:00
linux-6.1 possible deadlock in hfsplus_file_extend (2) 4 2 286d 286d 0/3 auto-obsoleted due to no activity on 2025/04/22 11:08
upstream possible deadlock in hfsplus_file_extend hfs 4 C error done 31659 376d 1064d 28/29 fixed on 2024/10/21 12:45

Sample crash report:
syz.0.17[5948]: memfd_create() called without MFD_EXEC or MFD_NOEXEC_SEAL set
loop0: detected capacity change from 0 to 1024
============================================
WARNING: possible recursive locking detected
syzkaller #0 Not tainted
--------------------------------------------
syz.0.17/5948 is trying to acquire lock:
ffff888026410108 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1fd/0x1990 fs/hfsplus/extents.c:455

but task is already holding lock:
ffff8880264122c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1fd/0x1990 fs/hfsplus/extents.c:455

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&HFSPLUS_I(inode)->extents_lock);
  lock(&HFSPLUS_I(inode)->extents_lock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

4 locks held by syz.0.17/5948:
 #0: ffff8880798d8418 (sb_writers#13){.+.+}-{0:0}, at: vfs_write+0x20e/0x940 fs/read_write.c:580
 #1: ffff8880264124d0 (&sb->s_type->i_mutex_key#20){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
 #1: ffff8880264124d0 (&sb->s_type->i_mutex_key#20){+.+.}-{3:3}, at: generic_file_write_iter+0x83/0x2e0 mm/filemap.c:4134
 #2: ffff8880264122c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1fd/0x1990 fs/hfsplus/extents.c:455
 #3: ffff8880798da0b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfsplus_find_init+0x154/0x1d0 fs/hfsplus/bfind.c:28

stack backtrace:
CPU: 1 PID: 5948 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
 check_deadlock kernel/locking/lockdep.c:3062 [inline]
 validate_chain kernel/locking/lockdep.c:3856 [inline]
 __lock_acquire+0x5d40/0x7c80 kernel/locking/lockdep.c:5137
 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x129/0xcc0 kernel/locking/mutex.c:747
 hfsplus_file_extend+0x1fd/0x1990 fs/hfsplus/extents.c:455
 hfsplus_bmap_reserve+0x122/0x500 fs/hfsplus/btree.c:358
 __hfsplus_ext_write_extent+0x28d/0x5b0 fs/hfsplus/extents.c:104
 __hfsplus_ext_cache_extent+0x89/0xe20 fs/hfsplus/extents.c:186
 hfsplus_ext_read_extent fs/hfsplus/extents.c:218 [inline]
 hfsplus_file_extend+0x445/0x1990 fs/hfsplus/extents.c:459
 hfsplus_get_block+0x412/0x1530 fs/hfsplus/extents.c:245
 __block_write_begin_int+0x566/0x1ad0 fs/buffer.c:2124
 __block_write_begin fs/buffer.c:2173 [inline]
 block_write_begin+0x9a/0x1e0 fs/buffer.c:2234
 cont_write_begin+0x5c8/0x7e0 fs/buffer.c:2591
 hfsplus_write_begin+0x8b/0xd0 fs/hfsplus/inode.c:52
 cont_expand_zero fs/buffer.c:2518 [inline]
 cont_write_begin+0x2ad/0x7e0 fs/buffer.c:2581
 hfsplus_write_begin+0x8b/0xd0 fs/hfsplus/inode.c:52
 generic_perform_write+0x2fb/0x5b0 mm/filemap.c:4016
 generic_file_write_iter+0xaf/0x2e0 mm/filemap.c:4137
 call_write_iter include/linux/fs.h:2018 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x43b/0x940 fs/read_write.c:584
 ksys_pwrite64 fs/read_write.c:699 [inline]
 __do_sys_pwrite64 fs/read_write.c:709 [inline]
 __se_sys_pwrite64 fs/read_write.c:706 [inline]
 __x64_sys_pwrite64+0x195/0x220 fs/read_write.c:706
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7efdf1b8eec9
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:00007ffcb839f878 EFLAGS: 00000246 ORIG_RAX: 0000000000000012
RAX: ffffffffffffffda RBX: 00007efdf1de5fa0 RCX: 00007efdf1b8eec9
RDX: 0000000000000001 RSI: 00002000000005c0 RDI: 0000000000000004
RBP: 00007efdf1c11f91 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000004fed0 R11: 0000000000000246 R12: 0000000000000000
R13: 00007efdf1de5fa0 R14: 00007efdf1de5fa0 R15: 0000000000000004
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/16 15:40 linux-6.6.y 0bbbd97a442d 19568248 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-6-kasan possible deadlock in hfsplus_file_extend
* Struck through repros no longer work on HEAD.