[v5.15] possible deadlock in hfsplus_file_extend (4)

0 views
Skip to first unread message

syzbot

unread,
Feb 10, 2026, 8:52:28 PM (3 days ago) Feb 10
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 7b232985052f Linux 5.15.199
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16afea52580000
kernel config: https://syzkaller.appspot.com/x/.config?x=353ae28c40b35af5
dashboard link: https://syzkaller.appspot.com/bug?extid=b4b6377d5ff1845d060d
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/97a23052e207/disk-7b232985.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e9871fb1bda3/vmlinux-7b232985.xz
kernel image: https://storage.googleapis.com/syzbot-assets/b08e48f5be44/bzImage-7b232985.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+b4b637...@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.4.1718/10942 is trying to acquire lock:
ffff88807d236648 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1cd/0x1a50 fs/hfsplus/extents.c:455

but task is already holding lock:
ffff8880789c40b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfsplus_find_init+0x150/0x1c0 fs/hfsplus/bfind.c:28

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&tree->tree_lock/1){+.+.}-{3:3}:
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
hfsplus_find_init+0x150/0x1c0 fs/hfsplus/bfind.c:28
hfsplus_file_truncate+0x3b6/0xb80 fs/hfsplus/extents.c:580
hfsplus_delete_inode+0x17c/0x230 fs/hfsplus/inode.c:-1
hfsplus_unlink+0x4f7/0x7b0 fs/hfsplus/dir.c:405
vfs_unlink+0x385/0x600 fs/namei.c:4288
do_unlinkat+0x391/0x710 fs/namei.c:4356
__do_sys_unlinkat fs/namei.c:4399 [inline]
__se_sys_unlinkat fs/namei.c:4392 [inline]
__x64_sys_unlinkat+0xd1/0xe0 fs/namei.c:4392
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #0 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
hfsplus_file_extend+0x1cd/0x1a50 fs/hfsplus/extents.c:455
hfsplus_bmap_reserve+0x11e/0x4f0 fs/hfsplus/btree.c:357
__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+0x4be/0x1a50 fs/hfsplus/extents.c:459
hfsplus_get_block+0x430/0x15a0 fs/hfsplus/extents.c:245
__block_write_begin_int+0x565/0x15d0 fs/buffer.c:2012
__block_write_begin fs/buffer.c:2062 [inline]
block_write_begin fs/buffer.c:2122 [inline]
cont_write_begin+0x598/0x7b0 fs/buffer.c:2471
hfsplus_write_begin+0x92/0xe0 fs/hfsplus/inode.c:53
generic_perform_write+0x2b6/0x550 mm/filemap.c:3785
__generic_file_write_iter+0x25f/0x4e0 mm/filemap.c:3912
generic_file_write_iter+0xa6/0x1b0 mm/filemap.c:3944
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x745/0xd60 fs/read_write.c:594
ksys_write+0x152/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&tree->tree_lock/1);
lock(
&HFSPLUS_I(inode)->extents_lock);
lock(&tree->tree_lock/1);
lock(&HFSPLUS_I(inode)->extents_lock);

*** DEADLOCK ***

5 locks held by syz.4.1718/10942:
#0: ffff888078274870 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x2bf/0x370 fs/file.c:1056
#1: ffff88801ee36460 (sb_writers#15){.+.+}-{0:0}, at: vfs_write+0x295/0xd60 fs/read_write.c:590
#2: ffff88807d233240 (&sb->s_type->i_mutex_key
#23){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
#23){+.+.}-{3:3}, at: generic_file_write_iter+0x7e/0x1b0 mm/filemap.c:3941
#3: ffff88807d233048 (&hip->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1cd/0x1a50 fs/hfsplus/extents.c:455
#4: ffff8880789c40b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfsplus_find_init+0x150/0x1c0 fs/hfsplus/bfind.c:28

stack backtrace:
CPU: 0 PID: 10942 Comm: syz.4.1718 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/24/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
hfsplus_file_extend+0x1cd/0x1a50 fs/hfsplus/extents.c:455
hfsplus_bmap_reserve+0x11e/0x4f0 fs/hfsplus/btree.c:357
__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+0x4be/0x1a50 fs/hfsplus/extents.c:459
hfsplus_get_block+0x430/0x15a0 fs/hfsplus/extents.c:245
__block_write_begin_int+0x565/0x15d0 fs/buffer.c:2012
__block_write_begin fs/buffer.c:2062 [inline]
block_write_begin fs/buffer.c:2122 [inline]
cont_write_begin+0x598/0x7b0 fs/buffer.c:2471
hfsplus_write_begin+0x92/0xe0 fs/hfsplus/inode.c:53
generic_perform_write+0x2b6/0x550 mm/filemap.c:3785
__generic_file_write_iter+0x25f/0x4e0 mm/filemap.c:3912
generic_file_write_iter+0xa6/0x1b0 mm/filemap.c:3944
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x745/0xd60 fs/read_write.c:594
ksys_write+0x152/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fe1ea5b6f79
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:00007fe1e8811028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fe1ea830fa0 RCX: 00007fe1ea5b6f79
RDX: 000000000208e24b RSI: 0000200000000040 RDI: 0000000000000004
RBP: 00007fe1ea64d7e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fe1ea831038 R14: 00007fe1ea830fa0 R15: 00007ffec0b021e8
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Feb 11, 2026, 10:48:37 AM (2 days ago) Feb 11
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 8ce36b2849ef Linux 6.1.163
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17430b3a580000
kernel config: https://syzkaller.appspot.com/x/.config?x=b1adc0bfde2d8a4a
dashboard link: https://syzkaller.appspot.com/bug?extid=65d55898e6b1bd038d24
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e71ac74ccc11/disk-8ce36b28.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a090f33b3222/vmlinux-8ce36b28.xz
kernel image: https://storage.googleapis.com/syzbot-assets/13fb3beccc73/Image-8ce36b28.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+65d558...@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.1.3723/13566 is trying to acquire lock:
ffff0000dd76a988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x18c/0x13b4 fs/hfsplus/extents.c:455

but task is already holding lock:
ffff0000d14f20b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfsplus_find_init+0x144/0x1bc fs/hfsplus/bfind.c:28

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&tree->tree_lock/1){+.+.}-{3:3}:
__mutex_lock_common+0x190/0x1f60 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
hfsplus_find_init+0x144/0x1bc fs/hfsplus/bfind.c:28
hfsplus_file_truncate+0x2ec/0x9ac fs/hfsplus/extents.c:580
hfsplus_delete_inode+0x160/0x20c fs/hfsplus/inode.c:-1
hfsplus_unlink+0x418/0x68c fs/hfsplus/dir.c:405
vfs_unlink+0x2e0/0x4f4 fs/namei.c:4330
do_unlinkat+0x328/0x500 fs/namei.c:4398
__do_sys_unlinkat fs/namei.c:4441 [inline]
__se_sys_unlinkat fs/namei.c:4434 [inline]
__arm64_sys_unlinkat+0xe0/0xfc fs/namei.c:4434
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b4 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x130 arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

-> #0 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain kernel/locking/lockdep.c:3825 [inline]
__lock_acquire+0x2880/0x6800 kernel/locking/lockdep.c:5049
lock_acquire+0x20c/0x63c kernel/locking/lockdep.c:5662
__mutex_lock_common+0x190/0x1f60 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
hfsplus_file_extend+0x18c/0x13b4 fs/hfsplus/extents.c:455
hfsplus_bmap_reserve+0xe8/0x494 fs/hfsplus/btree.c:358
__hfsplus_ext_write_extent+0x1e0/0x49c fs/hfsplus/extents.c:104
__hfsplus_ext_cache_extent+0x84/0xa84 fs/hfsplus/extents.c:186
hfsplus_ext_read_extent fs/hfsplus/extents.c:218 [inline]
hfsplus_file_extend+0x3bc/0x13b4 fs/hfsplus/extents.c:459
hfsplus_get_block+0x324/0x11a0 fs/hfsplus/extents.c:245
__block_write_begin_int+0x350/0x1388 fs/buffer.c:1991
__block_write_begin fs/buffer.c:2041 [inline]
block_write_begin fs/buffer.c:2102 [inline]
cont_write_begin+0x53c/0x780 fs/buffer.c:2456
hfsplus_write_begin+0x98/0xe4 fs/hfsplus/inode.c:52
generic_perform_write+0x234/0x4f4 mm/filemap.c:3862
__generic_file_write_iter+0x130/0x250 mm/filemap.c:3960
generic_file_write_iter+0xb4/0x2b0 mm/filemap.c:3989
call_write_iter include/linux/fs.h:2265 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x3ec/0x7f0 fs/read_write.c:584
ksys_write+0x12c/0x224 fs/read_write.c:637
__do_sys_write fs/read_write.c:649 [inline]
__se_sys_write fs/read_write.c:646 [inline]
__arm64_sys_write+0x7c/0x90 fs/read_write.c:646
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b4 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x130 arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

other info that might help us debug this:

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&tree->tree_lock/1);
lock(&HFSPLUS_I(inode)->extents_lock);
lock(&tree->tree_lock/1);
lock(&HFSPLUS_I(inode)->extents_lock);

*** DEADLOCK ***

5 locks held by syz.1.3723/13566:
#0: ffff0000d0c559e8 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x114/0x16c fs/file.c:1038
#1: ffff0000d1500460 (sb_writers#12){.+.+}-{0:0}, at: vfs_write+0x244/0x7f0 fs/read_write.c:580
#2: ffff0000dd76cd40 (&sb->s_type->i_mutex_key#20){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
#2: ffff0000dd76cd40 (&sb->s_type->i_mutex_key#20){+.+.}-{3:3}, at: generic_file_write_iter+0x84/0x2b0 mm/filemap.c:3986
#3: ffff0000dd76cb48 (&hip->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x18c/0x13b4 fs/hfsplus/extents.c:455
#4: ffff0000d14f20b0 (&tree->tree_lock/1){+.+.}-{3:3}, at: hfsplus_find_init+0x144/0x1bc fs/hfsplus/bfind.c:28

stack backtrace:
CPU: 0 PID: 13566 Comm: syz.1.3723 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
Call trace:
dump_backtrace+0x1c0/0x1ec arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack+0x30/0x40 lib/dump_stack.c:88
dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106
dump_stack+0x1c/0x5c lib/dump_stack.c:113
print_circular_bug+0x148/0x1b0 kernel/locking/lockdep.c:2048
check_noncircular+0x264/0x2f8 kernel/locking/lockdep.c:2170
check_prev_add kernel/locking/lockdep.c:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain kernel/locking/lockdep.c:3825 [inline]
__lock_acquire+0x2880/0x6800 kernel/locking/lockdep.c:5049
lock_acquire+0x20c/0x63c kernel/locking/lockdep.c:5662
__mutex_lock_common+0x190/0x1f60 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
hfsplus_file_extend+0x18c/0x13b4 fs/hfsplus/extents.c:455
hfsplus_bmap_reserve+0xe8/0x494 fs/hfsplus/btree.c:358
__hfsplus_ext_write_extent+0x1e0/0x49c fs/hfsplus/extents.c:104
__hfsplus_ext_cache_extent+0x84/0xa84 fs/hfsplus/extents.c:186
hfsplus_ext_read_extent fs/hfsplus/extents.c:218 [inline]
hfsplus_file_extend+0x3bc/0x13b4 fs/hfsplus/extents.c:459
hfsplus_get_block+0x324/0x11a0 fs/hfsplus/extents.c:245
__block_write_begin_int+0x350/0x1388 fs/buffer.c:1991
__block_write_begin fs/buffer.c:2041 [inline]
block_write_begin fs/buffer.c:2102 [inline]
cont_write_begin+0x53c/0x780 fs/buffer.c:2456
hfsplus_write_begin+0x98/0xe4 fs/hfsplus/inode.c:52
generic_perform_write+0x234/0x4f4 mm/filemap.c:3862
__generic_file_write_iter+0x130/0x250 mm/filemap.c:3960
generic_file_write_iter+0xb4/0x2b0 mm/filemap.c:3989
call_write_iter include/linux/fs.h:2265 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x3ec/0x7f0 fs/read_write.c:584
ksys_write+0x12c/0x224 fs/read_write.c:637
__do_sys_write fs/read_write.c:649 [inline]
__se_sys_write fs/read_write.c:646 [inline]
__arm64_sys_write+0x7c/0x90 fs/read_write.c:646
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b4 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x130 arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585
Reply all
Reply to author
Forward
0 new messages