syzbot


possible deadlock in hfs_extend_file (3)

Status: upstream: reported C repro on 2024/04/18 14:41
Subsystems: hfs
[Documentation on labels]
Reported-by: syzbot+2a62f58f1a4951a549bb@syzkaller.appspotmail.com
First crash: 594d, last: 2h37m
Cause bisection: introduced by (bisect log) [merge commit]:
commit e8c3f6322cc853084a6d63244c15fb0251090327
Author: Arnd Bergmann <arnd@arndb.de>
Date: Thu Oct 11 13:21:40 2018 +0000

  Merge tag 'imx-defconfig-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/defconfig

Crash: lost connection to test machine (log)
Repro: C syz .config
  
Discussions (3)
Title Replies (including bot) Last reply
[syzbot] Monthly hfs report (Oct 2025) 0 (1) 2025/10/27 12:50
[syzbot] [hfs?] possible deadlock in hfs_extend_file (3) 0 (2) 2024/06/23 09:36
[PATCH fs/hfs] hfs: fix deadlock in hfs_extend_file() 1 (1) 2024/04/23 09:31
Similar bugs (9)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 possible deadlock in hfs_extend_file hfs 4 1 1068d 1068d 0/1 upstream: reported on 2022/12/27 15:22
linux-5.15 possible deadlock in hfs_extend_file (2) 4 1 768d 768d 0/3 auto-obsoleted due to no activity on 2024/01/31 18:25
linux-6.1 possible deadlock in hfs_extend_file 4 7 806d 992d 0/3 auto-obsoleted due to no activity on 2023/12/24 21:20
upstream possible deadlock in hfs_extend_file hfs 4 46 829d 1073d 0/29 auto-obsoleted due to no activity on 2023/11/06 09:48
linux-6.1 possible deadlock in hfs_extend_file (2) origin:upstream 4 C 148 13d 604d 0/3 upstream: reported C repro on 2024/04/04 03:11
linux-5.15 possible deadlock in hfs_extend_file (3) 4 166 24d 626d 0/3 upstream: reported on 2024/03/13 05:11
linux-6.6 possible deadlock in hfs_extend_file origin:upstream missing-backport 4 C 39 6d05h 165d 0/2 upstream: reported C repro on 2025/06/17 13:12
upstream possible deadlock in hfs_extend_file (2) hfs 4 C done done 4 697d 718d 0/29 auto-obsoleted due to no activity on 2024/04/11 05:11
linux-5.15 possible deadlock in hfs_extend_file 4 5 893d 957d 0/3 auto-obsoleted due to no activity on 2023/09/28 05:53
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/08/31 11:43 59m retest repro upstream report log

Sample crash report:
WARNING: The mand mount option has been deprecated and
         and is ignored by this kernel. Remove the mand
         option from the mount to silence this warning.
=======================================================
============================================
WARNING: possible recursive locking detected
syzkaller #0 Not tainted
--------------------------------------------
syz.0.17/5962 is trying to acquire lock:
ffff8880315e0128 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_extend_file+0xda/0x14c0 fs/hfs/extent.c:397

but task is already holding lock:
ffff8880315e0868 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_extend_file+0xda/0x14c0 fs/hfs/extent.c:397

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

       CPU0
       ----
  lock(&HFS_I(tree->inode)->extents_lock);
  lock(&HFS_I(tree->inode)->extents_lock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

5 locks held by syz.0.17/5962:
 #0: ffff8880387b4480 (sb_writers#12){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:508
 #1: ffff888030d20300 (&type->i_mutex_dir_key#8){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:980 [inline]
 #1: ffff888030d20300 (&type->i_mutex_dir_key#8){+.+.}-{4:4}, at: open_last_lookups fs/namei.c:3892 [inline]
 #1: ffff888030d20300 (&type->i_mutex_dir_key#8){+.+.}-{4:4}, at: path_openat+0x8e6/0x3840 fs/namei.c:4131
 #2: ffff88803866a0a0 (&tree->tree_lock){+.+.}-{4:4}, at: hfs_find_init+0x18e/0x2c0 fs/hfs/bfind.c:-1
 #3: ffff8880315e0868 (&HFS_I(tree->inode)->extents_lock){+.+.}-{4:4}, at: hfs_extend_file+0xda/0x14c0 fs/hfs/extent.c:397
 #4: ffff8880386680a0 (&tree->tree_lock/1){+.+.}-{4:4}, at: hfs_find_init+0x18e/0x2c0 fs/hfs/bfind.c:-1

stack backtrace:
CPU: 1 UID: 0 PID: 5962 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 print_deadlock_bug+0x28b/0x2a0 kernel/locking/lockdep.c:3041
 check_deadlock kernel/locking/lockdep.c:3093 [inline]
 validate_chain+0x1a3f/0x2140 kernel/locking/lockdep.c:3895
 __lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5237
 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868
 __mutex_lock_common kernel/locking/rtmutex_api.c:535 [inline]
 mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:547
 hfs_extend_file+0xda/0x14c0 fs/hfs/extent.c:397
 hfs_bmap_reserve+0x107/0x430 fs/hfs/btree.c:269
 __hfs_ext_write_extent+0x1fa/0x470 fs/hfs/extent.c:121
 __hfs_ext_cache_extent+0x6b/0x9b0 fs/hfs/extent.c:174
 hfs_ext_read_extent fs/hfs/extent.c:202 [inline]
 hfs_extend_file+0x31e/0x14c0 fs/hfs/extent.c:401
 hfs_bmap_reserve+0x107/0x430 fs/hfs/btree.c:269
 hfs_cat_create+0x1c5/0x730 fs/hfs/catalog.c:104
 hfs_create+0x66/0xe0 fs/hfs/dir.c:202
 lookup_open fs/namei.c:3796 [inline]
 open_last_lookups fs/namei.c:3895 [inline]
 path_openat+0x1500/0x3840 fs/namei.c:4131
 do_filp_open+0x1fa/0x410 fs/namei.c:4161
 do_sys_openat2+0x121/0x1c0 fs/open.c:1437
 do_sys_open fs/open.c:1452 [inline]
 __do_sys_open fs/open.c:1460 [inline]
 __se_sys_open fs/open.c:1456 [inline]
 __x64_sys_open+0x11e/0x150 fs/open.c:1456
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fd0b1c0eec9
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:00007fff6de76808 EFLAGS: 00000246 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 00007fd0b1e65fa0 RCX: 00007fd0b1c0eec9
RDX: 0000000000000000 RSI: 000000000014927e RDI: 0000200000000180
RBP: 00007fd0b1c91f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd0b1e65fa0 R14: 00007fd0b1e65fa0 R15: 0000000000000003
 </TASK>

Crashes (3023):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/10 14:43 upstream 5472d60c129f ff1712fe .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs possible deadlock in hfs_extend_file
2024/06/23 09:36 upstream 563a50672d8a edc5149a .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-upstream-fs possible deadlock in hfs_extend_file
2025/10/10 12:48 upstream 5472d60c129f ff1712fe .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root possible deadlock in hfs_extend_file
2024/12/13 13:29 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 2e7aff49b5da 3547e30f .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci-upstream-gce-arm64 possible deadlock in hfs_extend_file
2025/11/29 20:15 upstream 19eef1d98eed d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in hfs_extend_file
2025/11/28 10:43 upstream e1afacb68573 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in hfs_extend_file
2025/11/28 05:10 upstream aa7243aaf194 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/27 22:44 upstream 765e56e41a5a d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in hfs_extend_file
2025/11/27 17:55 upstream 765e56e41a5a d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/27 02:22 upstream 4941a17751c9 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/26 21:12 upstream 30f09200cc4a d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in hfs_extend_file
2025/11/26 09:53 upstream 30f09200cc4a 64219f15 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/25 23:26 upstream 8a2bcda5e139 64219f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in hfs_extend_file
2025/11/25 14:24 upstream ac3fd01e4c1e 64219f15 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/25 13:21 upstream ac3fd01e4c1e 64219f15 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/24 06:34 upstream ac3fd01e4c1e 4fb8ef37 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/24 03:47 upstream d13f3ac64efb 4fb8ef37 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/24 02:20 upstream d13f3ac64efb 4fb8ef37 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/23 17:27 upstream d13f3ac64efb 4fb8ef37 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/23 13:08 upstream 89edd36fd801 4fb8ef37 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/23 01:04 upstream 89edd36fd801 4fb8ef37 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/21 14:47 upstream fd95357fd8c6 280ea308 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in hfs_extend_file
2025/11/21 08:28 upstream fd95357fd8c6 280ea308 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/21 06:01 upstream 8e621c9a3375 280ea308 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/21 04:32 upstream 8e621c9a3375 280ea308 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/20 06:04 upstream 23cb64fb7625 26ee5237 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in hfs_extend_file
2025/11/19 05:20 upstream 5bebe8de1926 ef766cd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in hfs_extend_file
2025/11/18 22:25 upstream 5bebe8de1926 ef766cd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in hfs_extend_file
2025/11/18 22:24 upstream 5bebe8de1926 ef766cd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in hfs_extend_file
2025/11/18 19:18 upstream 5bebe8de1926 ef766cd7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/18 15:28 upstream e7c375b18160 ef766cd7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/18 13:06 upstream e7c375b18160 ef766cd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in hfs_extend_file
2025/11/18 01:56 upstream e7c375b18160 ef766cd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in hfs_extend_file
2025/11/01 08:09 upstream ba36dd5ee6fd 2c50b6a9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in hfs_extend_file
2024/06/23 20:30 upstream 7c16f0a4ed1c edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in hfs_extend_file
2024/06/21 22:01 upstream 66cc544fd75c edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in hfs_extend_file
2024/04/14 14:39 upstream fe46a7dd189e c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in hfs_extend_file
2025/11/28 08:13 upstream aa7243aaf194 e8331348 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in hfs_extend_file
2025/11/27 07:53 upstream 4941a17751c9 e8331348 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in hfs_extend_file
2025/11/26 16:11 upstream 30f09200cc4a c116feb4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in hfs_extend_file
2025/11/25 19:34 upstream 8a2bcda5e139 bf6fe8fe .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in hfs_extend_file
2025/11/25 08:32 upstream ac3fd01e4c1e bf6fe8fe .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in hfs_extend_file
2025/11/24 19:48 upstream ac3fd01e4c1e bf6fe8fe .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in hfs_extend_file
2025/11/23 20:52 upstream d13f3ac64efb 4fb8ef37 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in hfs_extend_file
2025/11/22 08:29 upstream 2eba5e05d9bc 4fb8ef37 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in hfs_extend_file
2025/11/21 21:48 upstream fd95357fd8c6 c31c1b0b .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in hfs_extend_file
2025/11/20 00:11 upstream 23cb64fb7625 26ee5237 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in hfs_extend_file
2025/11/18 21:20 upstream 5bebe8de1926 ef766cd7 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in hfs_extend_file
2025/11/18 07:43 upstream e7c375b18160 ef766cd7 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in hfs_extend_file
2024/06/04 08:08 upstream 2ab795141095 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in hfs_extend_file
2024/06/21 20:55 upstream 66cc544fd75c c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in hfs_extend_file
2025/11/26 23:54 linux-next 663d0d1af3fa d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/25 03:38 linux-next 422f3140bbcb 64219f15 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/24 16:01 linux-next 422f3140bbcb bf6fe8fe .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/24 10:56 linux-next d724c6f85e80 4fb8ef37 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/24 08:08 linux-next d724c6f85e80 4fb8ef37 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/20 09:59 linux-next 88cbd8ac379c 26ee5237 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in hfs_extend_file
2025/11/20 20:49 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci ef10811e9f56 280ea308 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in hfs_extend_file
* Struck through repros no longer work on HEAD.