[v5.15] possible deadlock in hfsplus_block_free (5)

0 views
Skip to first unread message

syzbot

unread,
May 3, 2026, 10:29:24 PM (23 hours ago) May 3
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: ef251c45f1cd Linux 5.15.204
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15b9aece580000
kernel config: https://syzkaller.appspot.com/x/.config?x=353ae28c40b35af5
dashboard link: https://syzkaller.appspot.com/bug?extid=b35985b59161736b860d
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/bde897c3d01f/disk-ef251c45.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/51b2a5826cd1/vmlinux-ef251c45.xz
kernel image: https://storage.googleapis.com/syzbot-assets/cb95a5a40121/bzImage-ef251c45.xz

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

======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.4.173/4917 is trying to acquire lock:
ffff888024d998f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_free+0xc1/0x4d0 fs/hfsplus/bitmap.c:182

but task is already holding lock:
ffff888078aba988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2c6/0xb80 fs/hfsplus/extents.c:574

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{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_get_block+0x3a1/0x15a0 fs/hfsplus/extents.c:260
block_read_full_page+0x306/0xd40 fs/buffer.c:2290
do_read_cache_page+0x8a1/0x1030 mm/filemap.c:-1
read_mapping_page include/linux/pagemap.h:515 [inline]
hfsplus_block_allocate+0xf1/0x910 fs/hfsplus/bitmap.c:37
hfsplus_file_extend+0xb1f/0x1a50 fs/hfsplus/extents.c:466
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
__page_symlink+0x102/0x200 fs/namei.c:5199
hfsplus_symlink+0xc6/0x260 fs/hfsplus/dir.c:449
vfs_symlink+0x247/0x3d0 fs/namei.c:4437
do_symlinkat+0x1ab/0x6b0 fs/namei.c:4466
__do_sys_symlink fs/namei.c:4488 [inline]
__se_sys_symlink fs/namei.c:4486 [inline]
__x64_sys_symlink+0x7a/0x90 fs/namei.c:4486
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 (&sbi->alloc_mutex){+.+.}-{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_block_free+0xc1/0x4d0 fs/hfsplus/bitmap.c:182
hfsplus_free_extents+0x10d/0xa50 fs/hfsplus/extents.c:360
hfsplus_file_truncate+0x783/0xb80 fs/hfsplus/extents.c:589
hfsplus_delete_inode fs/hfsplus/inode.c:-1 [inline]
hfsplus_file_release+0x2ff/0x3d0 fs/hfsplus/inode.c:260
__fput+0x234/0x930 fs/file_table.c:311
task_work_run+0x125/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&HFSPLUS_I(inode)->extents_lock);
lock(&sbi->alloc_mutex);
lock(&HFSPLUS_I(inode)->extents_lock);
lock(&sbi->alloc_mutex);

*** DEADLOCK ***

2 locks held by syz.4.173/4917:
#0: ffff888078abab80 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
#0: ffff888078abab80 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: hfsplus_file_release+0xde/0x3d0 fs/hfsplus/inode.c:255
#1: ffff888078aba988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2c6/0xb80 fs/hfsplus/extents.c:574

stack backtrace:
CPU: 1 PID: 4917 Comm: syz.4.173 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/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_block_free+0xc1/0x4d0 fs/hfsplus/bitmap.c:182
hfsplus_free_extents+0x10d/0xa50 fs/hfsplus/extents.c:360
hfsplus_file_truncate+0x783/0xb80 fs/hfsplus/extents.c:589
hfsplus_delete_inode fs/hfsplus/inode.c:-1 [inline]
hfsplus_file_release+0x2ff/0x3d0 fs/hfsplus/inode.c:260
__fput+0x234/0x930 fs/file_table.c:311
task_work_run+0x125/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f5a198d0dd9
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:00007ffc0050a038 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007ffc0050a120 RCX: 00007f5a198d0dd9
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 000000000001d048 R08: 0000000000000001 R09: 0000000000000000
R10: 0000001b31c20000 R11: 0000000000000246 R12: 00007ffc0050a160
R13: 00007f5a19b49fac R14: 000000000001d177 R15: 00007f5a19b49fa0
</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
Reply all
Reply to author
Forward
0 new messages