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: 635d, last: 93d
Fix bisection: failed (error log, bisect log)
  
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 51400 118d 744d 27/28 fixed on 2024/08/14 03:44
linux-5.15 possible deadlock in hfsplus_file_truncate missing-backport C inconclusive 5300 112d 639d 0/3 auto-obsoleted due to no activity on 2024/10/28 04:09
linux-4.19 possible deadlock in hfsplus_file_truncate hfsplus C 165 643d 743d 0/1 upstream: reported C repro on 2022/11/27 09:20
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2024/10/15 00:58 0m bisect fix linux-6.1.y error job log
2024/09/07 13:09 2h00m bisect fix linux-6.1.y OK (0) job log log
2023/10/06 15:28 1h27m fix candidate upstream OK (0) job log 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 (4262):
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/08/03 06:14 linux-6.1.y c1cec4dad96b 1786a2a8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/08/03 06:06 linux-6.1.y c1cec4dad96b 1786a2a8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/08/03 05:05 linux-6.1.y c1cec4dad96b 1786a2a8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/08/03 00:39 linux-6.1.y c1cec4dad96b 1786a2a8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/08/03 00:14 linux-6.1.y c1cec4dad96b 1786a2a8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/08/02 23:09 linux-6.1.y c1cec4dad96b 1786a2a8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/08/01 09:35 linux-6.1.y c1cec4dad96b 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/08/01 04:30 linux-6.1.y c1cec4dad96b 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/08/01 03:23 linux-6.1.y c1cec4dad96b 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/08/01 01:29 linux-6.1.y c1cec4dad96b 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/31 22:57 linux-6.1.y c1cec4dad96b 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/31 19:19 linux-6.1.y c1cec4dad96b 6fde257d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/31 16:17 linux-6.1.y c1cec4dad96b 6fde257d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/31 03:58 linux-6.1.y c1cec4dad96b 6fde257d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/31 00:14 linux-6.1.y c1cec4dad96b 6fde257d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/30 21:15 linux-6.1.y c1cec4dad96b 6fde257d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/30 18:56 linux-6.1.y c1cec4dad96b 6fde257d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/30 17:17 linux-6.1.y c1cec4dad96b 6fde257d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/30 14:54 linux-6.1.y c1cec4dad96b 5187fc86 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/29 22:39 linux-6.1.y c1cec4dad96b 5187fc86 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/29 20:05 linux-6.1.y c1cec4dad96b 5187fc86 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/29 18:20 linux-6.1.y c1cec4dad96b 5187fc86 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/29 16:56 linux-6.1.y c1cec4dad96b 5187fc86 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/29 14:32 linux-6.1.y c1cec4dad96b 5187fc86 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/29 13:28 linux-6.1.y c1cec4dad96b 5187fc86 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/29 11:02 linux-6.1.y c1cec4dad96b 5187fc86 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/29 08:23 linux-6.1.y c1cec4dad96b 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/27 21:56 linux-6.1.y c1cec4dad96b 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/27 17:27 linux-6.1.y c1cec4dad96b 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/27 16:25 linux-6.1.y c1cec4dad96b 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/07/27 15:01 linux-6.1.y c1cec4dad96b 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_truncate
2024/08/03 03:52 linux-6.1.y c1cec4dad96b 1786a2a8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/03 02:00 linux-6.1.y c1cec4dad96b 1786a2a8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/02 19:30 linux-6.1.y c1cec4dad96b 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/02 15:38 linux-6.1.y c1cec4dad96b 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/02 08:05 linux-6.1.y c1cec4dad96b 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/02 00:15 linux-6.1.y c1cec4dad96b 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/01 05:38 linux-6.1.y c1cec4dad96b 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/07/30 22:15 linux-6.1.y c1cec4dad96b 6fde257d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/07/30 15:48 linux-6.1.y c1cec4dad96b 6fde257d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/07/29 08:13 linux-6.1.y c1cec4dad96b 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/07/29 02:17 linux-6.1.y c1cec4dad96b 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/07/27 13:40 linux-6.1.y c1cec4dad96b 46eb10b7 .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.