Hello,
syzbot found the following issue on:
HEAD commit: 50cbba13faa2 Linux 6.1.159
git tree: linux-6.1.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=13300efc580000
kernel config:
https://syzkaller.appspot.com/x/.config?x=31ea1cecaf34f0db
dashboard link:
https://syzkaller.appspot.com/bug?extid=02a134d0550d5b01e370
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.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/7ad0bd66715a/disk-50cbba13.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/3284d626258e/vmlinux-50cbba13.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/a1f92ca7bbfc/Image-50cbba13.gz.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+02a134...@syzkaller.appspotmail.com
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz-executor/4320 is trying to acquire lock:
ffff0000d95c58f8 (&sbi->alloc_mutex){+.+.}-{3:3}, at: hfsplus_block_free+0xb8/0x47c fs/hfsplus/bitmap.c:182
but task is already holding lock:
ffff0000f58d1548 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x20c/0x970 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+0x190/0x1f38 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
hfsplus_get_block+0x2bc/0x1154 fs/hfsplus/extents.c:260
block_read_full_folio+0x2e4/0x97c fs/buffer.c:2271
hfsplus_read_folio+0x28/0x38 fs/hfsplus/inode.c:28
filemap_read_folio+0x130/0x37c mm/filemap.c:2490
do_read_cache_folio+0x24c/0x544 mm/filemap.c:3659
do_read_cache_page mm/filemap.c:3701 [inline]
read_cache_page+0x6c/0x184 mm/filemap.c:3710
read_mapping_page include/linux/pagemap.h:793 [inline]
hfsplus_block_allocate+0xdc/0x7d8 fs/hfsplus/bitmap.c:37
hfsplus_file_extend+0x73c/0x1324 fs/hfsplus/extents.c:466
hfsplus_get_block+0x314/0x1154 fs/hfsplus/extents.c:245
__block_write_begin_int+0x34c/0x13b8 fs/buffer.c:1991
__block_write_begin fs/buffer.c:2041 [inline]
block_write_begin fs/buffer.c:2102 [inline]
cont_write_begin+0x548/0x780 fs/buffer.c:2456
hfsplus_write_begin+0x98/0xe4 fs/hfsplus/inode.c:52
cont_expand_zero fs/buffer.c:2383 [inline]
cont_write_begin+0x268/0x780 fs/buffer.c:2446
hfsplus_write_begin+0x98/0xe4 fs/hfsplus/inode.c:52
generic_perform_write+0x230/0x4e4 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+0x5ac/0x7c4 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]
__arm64_sys_pwrite64+0x170/0x200 fs/read_write.c:706
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x138 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 (&sbi->alloc_mutex){+.+.}-{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+0x293c/0x6544 kernel/locking/lockdep.c:5049
lock_acquire+0x20c/0x644 kernel/locking/lockdep.c:5662
__mutex_lock_common+0x190/0x1f38 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
hfsplus_block_free+0xb8/0x47c fs/hfsplus/bitmap.c:182
hfsplus_free_extents+0x10c/0x880 fs/hfsplus/extents.c:360
hfsplus_file_truncate+0x5e0/0x970 fs/hfsplus/extents.c:589
hfsplus_delete_inode+0x164/0x210 fs/hfsplus/inode.c:-1
hfsplus_unlink+0x3f8/0x664 fs/hfsplus/dir.c:405
vfs_unlink+0x2e0/0x4f4 fs/namei.c:4330
do_unlinkat+0x31c/0x4e8 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/0x2bc arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x138 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(&HFSPLUS_I(inode)->extents_lock);
lock(&sbi->alloc_mutex);
lock(&HFSPLUS_I(inode)->extents_lock);
lock(&sbi->alloc_mutex);
*** DEADLOCK ***
5 locks held by syz-executor/4320:
#0: ffff0000c4934460 (sb_writers#19){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:402
#1: ffff0000fc3f1740 (&type->i_mutex_dir_key#14/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline]
#1: ffff0000fc3f1740 (&type->i_mutex_dir_key#14/1){+.+.}-{3:3}, at: do_unlinkat+0x18c/0x4e8 fs/namei.c:4381
#2: ffff0000f58d1740 (&sb->s_type->i_mutex_key#23){++++}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
#2: ffff0000f58d1740 (&sb->s_type->i_mutex_key#23){++++}-{3:3}, at: vfs_unlink+0xd0/0x4f4 fs/namei.c:4319
#3: ffff0000d95c5998 (&sbi->vh_mutex){+.+.}-{3:3}, at: hfsplus_unlink+0x140/0x664 fs/hfsplus/dir.c:370
#4: ffff0000f58d1548 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x20c/0x970 fs/hfsplus/extents.c:574
stack backtrace:
CPU: 1 PID: 4320 Comm: syz-executor Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
Call trace:
dump_backtrace+0x1c8/0x1f4 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+0xf8/0x160 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+0x240/0x2d4 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+0x293c/0x6544 kernel/locking/lockdep.c:5049
lock_acquire+0x20c/0x644 kernel/locking/lockdep.c:5662
__mutex_lock_common+0x190/0x1f38 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
hfsplus_block_free+0xb8/0x47c fs/hfsplus/bitmap.c:182
hfsplus_free_extents+0x10c/0x880 fs/hfsplus/extents.c:360
hfsplus_file_truncate+0x5e0/0x970 fs/hfsplus/extents.c:589
hfsplus_delete_inode+0x164/0x210 fs/hfsplus/inode.c:-1
hfsplus_unlink+0x3f8/0x664 fs/hfsplus/dir.c:405
vfs_unlink+0x2e0/0x4f4 fs/namei.c:4330
do_unlinkat+0x31c/0x4e8 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/0x2bc arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
el0_svc+0x58/0x138 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
hfsplus: unable to mark blocks free: error -5
hfsplus: can't free extent
hfsplus: unable to mark blocks free: error -5
hfsplus: can't free extent
hfsplus: unable to mark blocks free: error -5
hfsplus: can't free extent
hfsplus: invalid extended attribute record
hfsplus: unable to mark blocks free: error -5
hfsplus: can't free extent
hfsplus: unable to mark blocks free: error -5
hfsplus: can't free extent
---
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