syzbot


possible deadlock in hfsplus_file_truncate

Status: upstream: reported C repro on 2023/03/15 11:18
Bug presence: origin:lts-only
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+9d8847efe150ee2e2bcb@syzkaller.appspotmail.com
First crash: 459d, last: 2h18m
Bug presence (2)
Date Name Commit Repro Result
2023/09/13 linux-6.1.y (ToT) 09045dae0d90 C [report] possible deadlock in hfsplus_file_truncate
2023/09/13 upstream (ToT) 3669558bdf35 C Didn't crash
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in hfsplus_file_truncate hfs C error 45188 now 568d 1/27 upstream: reported C repro on 2022/11/26 08:07
linux-5.15 possible deadlock in hfsplus_file_truncate missing-backport origin:upstream C error 3508 31m 463d 0/3 upstream: reported C repro on 2023/03/11 19:42
linux-4.19 possible deadlock in hfsplus_file_truncate hfsplus C 165 467d 567d 0/1 upstream: reported C repro on 2022/11/27 09:20
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2023/10/06 15:28 1h27m fix candidate upstream job log (0) log

Sample crash report:
loop4: detected capacity change from 0 to 1024
======================================================
WARNING: possible circular locking dependency detected
6.1.64-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor346/3639 is trying to acquire lock:
ffff8880795bc0b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x80d/0xb40 fs/hfsplus/extents.c:595

but task is already holding lock:
ffff8880187b07c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2d6/0xb40 fs/hfsplus/extents.c:576

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}:
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5661
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747
       hfsplus_file_extend+0x1d2/0x1b10 fs/hfsplus/extents.c:457
       hfsplus_bmap_reserve+0x101/0x4e0 fs/hfsplus/btree.c:358
       hfsplus_rename_cat+0x1cf/0x1090 fs/hfsplus/catalog.c:456
       hfsplus_rename+0x12a/0x1b0 fs/hfsplus/dir.c:552
       vfs_rename+0xbfc/0xf90 fs/namei.c:4786
       do_renameat2+0xcbd/0x1300 fs/namei.c:4936
       __do_sys_rename fs/namei.c:4982 [inline]
       __se_sys_rename fs/namei.c:4980 [inline]
       __x64_sys_rename+0x82/0x90 fs/namei.c:4980
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&tree->tree_lock){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3090 [inline]
       check_prevs_add kernel/locking/lockdep.c:3209 [inline]
       validate_chain+0x1667/0x58e0 kernel/locking/lockdep.c:3824
       __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5048
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5661
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747
       hfsplus_file_truncate+0x80d/0xb40 fs/hfsplus/extents.c:595
       hfsplus_setattr+0x1b9/0x280 fs/hfsplus/inode.c:269
       notify_change+0xce3/0xfc0 fs/attr.c:499
       do_truncate+0x21c/0x300 fs/open.c:65
       do_sys_ftruncate+0x2e2/0x380 fs/open.c:193
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

3 locks held by syz-executor346/3639:
 #0: ffff88807a6e6460 (sb_writers#9){.+.+}-{0:0}, at: do_sys_ftruncate+0x251/0x380 fs/open.c:190
 #1: ffff8880187b09c0 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline]
 #1: ffff8880187b09c0 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: do_truncate+0x208/0x300 fs/open.c:63
 #2: ffff8880187b07c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2d6/0xb40 fs/hfsplus/extents.c:576

stack backtrace:
CPU: 0 PID: 3639 Comm: syz-executor346 Not tainted 6.1.64-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 check_noncircular+0x2fa/0x3b0 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+0x1667/0x58e0 kernel/locking/lockdep.c:3824
 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5048
 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5661
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747
 hfsplus_file_truncate+0x80d/0xb40 fs/hfsplus/extents.c:595
 hfsplus_setattr+0x1b9/0x280 fs/hfsplus/inode.c:269
 notify_change+0xce3/0xfc0 fs/attr.c:499
 do_truncate+0x21c/0x300 fs/open.c:65
 do_sys_ftruncate+0x2e2/0x380 fs/open.c:193
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f8add392459
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 21 18 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffddb71a828 EFLAGS: 00000246 ORIG_RAX: 000000000000004d
RAX: ffffffffffffffda RBX: 0031656c69662f2e RCX: 00007f8add392459
RDX: 00007f8add392459 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 0073756c70736668 R08: 00007ffddb71a860 R09: 00007ffddb71a860
R10: 00000000200003c0 R11: 0000000000000246 R12: 00007ffddb71a84c
R13: 0000000000000009 R14: 431bde82d7b634db R15: 00007ffddb71a880
 </TASK>

Crashes (3457):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/12/02 06:50 linux-6.1.y 6ac30d748bb0 f819d6f7 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2023/09/13 07:48 linux-6.1.y 59b13c2b647e 59da8366 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/04/02 07:21 linux-6.1.y e5cd595e23c1 6baf5069 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2023/12/03 14:37 linux-6.1.y c6114c845984 f819d6f7 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2023/06/04 17:51 linux-6.1.y d2869ace6eeb a4ae4f42 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2023/07/30 08:51 linux-6.1.y d2a6dc4eaf6d 92476829 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2023/07/09 16:58 linux-6.1.y 61fd484b2cf6 668cb1fa .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/16 12:43 linux-6.1.y eb44d83053d6 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/16 12:43 linux-6.1.y eb44d83053d6 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/16 10:31 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/16 04:09 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/16 02:08 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/16 01:39 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/16 00:18 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/15 19:46 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/15 18:09 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/15 14:36 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/15 12:35 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/15 09:42 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/15 06:46 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/15 04:51 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/15 00:48 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/14 22:15 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/14 19:35 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/14 17:29 linux-6.1.y ae9f2a70d69e 8d849073 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/14 12:28 linux-6.1.y ae9f2a70d69e 8d849073 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/14 11:05 linux-6.1.y ae9f2a70d69e 8d849073 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/14 09:44 linux-6.1.y ae9f2a70d69e 8d849073 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/14 03:25 linux-6.1.y ae9f2a70d69e a9616ff5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/13 21:14 linux-6.1.y ae9f2a70d69e a9616ff5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/13 18:40 linux-6.1.y ae9f2a70d69e a9616ff5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/13 13:56 linux-6.1.y ae9f2a70d69e a9616ff5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/13 06:56 linux-6.1.y ae9f2a70d69e 2aa5052f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/13 05:56 linux-6.1.y ae9f2a70d69e 2aa5052f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/13 04:52 linux-6.1.y ae9f2a70d69e 2aa5052f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/13 01:47 linux-6.1.y ae9f2a70d69e 2aa5052f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/13 01:47 linux-6.1.y ae9f2a70d69e 2aa5052f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/12 17:09 linux-6.1.y ae9f2a70d69e f815599d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/06/16 17:52 linux-6.1.y eb44d83053d6 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/06/16 15:58 linux-6.1.y eb44d83053d6 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/06/16 14:46 linux-6.1.y eb44d83053d6 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/06/16 09:25 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/06/16 06:30 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/06/15 23:18 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/06/15 21:31 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/06/15 14:01 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/06/15 08:05 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/06/15 03:33 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/06/14 14:32 linux-6.1.y ae9f2a70d69e 8d849073 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/06/14 13:29 linux-6.1.y ae9f2a70d69e 8d849073 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/06/14 00:22 linux-6.1.y ae9f2a70d69e a9616ff5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/06/13 17:35 linux-6.1.y ae9f2a70d69e a9616ff5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/06/12 15:54 linux-6.1.y ae9f2a70d69e f815599d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2023/03/15 11:17 linux-6.1.y 6449a0ba6843 18b58603 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
* Struck through repros no longer work on HEAD.