syzbot


possible deadlock in hfsplus_file_truncate

Status: upstream: reported C repro on 2023/03/11 19:42
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+c9d1923ec3044ae3609c@syzkaller.appspotmail.com
First crash: 351d, last: 2d21h
Bug presence (1)
Date Name Commit Repro Result
2024/02/07 upstream (ToT) 6d280f4d760e C [report] possible deadlock in hfsplus_file_truncate
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 9039 now 456d 0/26 upstream: reported C repro on 2022/11/26 08:07
linux-6.1 possible deadlock in hfsplus_file_truncate missing-backport origin:lts-only C 577 1d04h 347d 0/3 upstream: reported C repro on 2023/03/15 11:18
linux-4.19 possible deadlock in hfsplus_file_truncate hfsplus C 165 356d 455d 0/1 upstream: reported C repro on 2022/11/27 09:20
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2023/12/27 03:07 0m fix candidate upstream error job log (0)
2023/11/23 23:05 0m fix candidate upstream error job log (0)

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 circular locking dependency detected
5.15.148-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor275/3824 is trying to acquire lock:
ffff88807c6d60b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x864/0xb80 fs/hfsplus/extents.c:595

but task is already holding lock:
ffff888076222988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2e1/0xb80 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+0x1db/0x4f0 kernel/locking/lockdep.c:5623
       __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       hfsplus_file_extend+0x1d2/0x1b10 fs/hfsplus/extents.c:457
       hfsplus_bmap_reserve+0x101/0x4e0 fs/hfsplus/btree.c:357
       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:4819
       do_renameat2+0xd74/0x1660 fs/namei.c:4971
       __do_sys_rename fs/namei.c:5017 [inline]
       __se_sys_rename fs/namei.c:5015 [inline]
       __x64_sys_rename+0x82/0x90 fs/namei.c:5015
       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+0x61/0xcb

-> #0 (&tree->tree_lock){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788
       __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
       __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       hfsplus_file_truncate+0x864/0xb80 fs/hfsplus/extents.c:595
       hfsplus_setattr+0x1b9/0x280 fs/hfsplus/inode.c:267
       notify_change+0xc6d/0xf50 fs/attr.c:505
       do_truncate+0x21c/0x300 fs/open.c:65
       vfs_truncate+0x2dd/0x3a0 fs/open.c:111
       do_sys_truncate+0xda/0x190 fs/open.c:134
       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+0x61/0xcb

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-executor275/3824:
 #0: ffff88807ac10460 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:377
 #1: ffff888076222b80 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
 #1: ffff888076222b80 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: do_truncate+0x208/0x300 fs/open.c:63
 #2: ffff888076222988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2e1/0xb80 fs/hfsplus/extents.c:576

stack backtrace:
CPU: 0 PID: 3824 Comm: syz-executor275 Not tainted 5.15.148-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 check_noncircular+0x2f8/0x3b0 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+0x1649/0x5930 kernel/locking/lockdep.c:3788
 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
 hfsplus_file_truncate+0x864/0xb80 fs/hfsplus/extents.c:595
 hfsplus_setattr+0x1b9/0x280 fs/hfsplus/inode.c:267
 notify_change+0xc6d/0xf50 fs/attr.c:505
 do_truncate+0x21c/0x300 fs/open.c:65
 vfs_truncate+0x2dd/0x3a0 fs/open.c:111
 do_sys_truncate+0xda/0x190 fs/open.c:134
 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+0x61/0xcb
RIP: 0033:0x7f699e98c3a9
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:00007ffd71bdd028 EFLAGS: 00000246 ORIG_RAX: 000000000000004c
RAX: ffffffffffffffda RBX: 0031656c69662f2e RCX: 00007f699e98c3a9
RDX: 00007f699e98b540 RSI: 0000000000000000 RDI: 0000000020000200
RBP: 00007f699e9d50a0 R08: 0000000000000632 R09: 00000000200003c0
R10: 00007ffd71bdcef0 R11: 0000000000000246 R12: 00007ffd71bdd05c
R13: 000000000000010e R14: 431bde82d7b634db R15: 00007ffd71bdd090
 </TASK>

Crashes (638):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/02/07 01:50 linux-5.15.y 6139f2a02fe0 6404acf9 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2023/06/04 17:05 linux-5.15.y 0ab06468cbd1 a4ae4f42 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2023/07/19 17:42 linux-5.15.y d54cfc420586 022df2bb .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2023/06/25 10:59 linux-5.15.y f67653019430 79782afc .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2023/06/24 08:34 linux-5.15.y f67653019430 79782afc .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2023/10/27 23:10 linux-5.15.y 12952a23a5da 3c418d72 .config console log report syz [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/23 10:04 linux-5.15.y 458ce51d0356 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/23 01:48 linux-5.15.y 6139f2a02fe0 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/21 11:55 linux-5.15.y 6139f2a02fe0 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/21 06:50 linux-5.15.y 6139f2a02fe0 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/20 09:19 linux-5.15.y 6139f2a02fe0 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/19 15:56 linux-5.15.y 6139f2a02fe0 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/19 13:22 linux-5.15.y 6139f2a02fe0 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/18 20:49 linux-5.15.y 6139f2a02fe0 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/18 11:57 linux-5.15.y 6139f2a02fe0 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/17 05:10 linux-5.15.y 6139f2a02fe0 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/16 04:22 linux-5.15.y 6139f2a02fe0 fd39cf6f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/15 17:58 linux-5.15.y 6139f2a02fe0 fd39cf6f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/15 10:52 linux-5.15.y 6139f2a02fe0 d9b1cdd5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/14 21:40 linux-5.15.y 6139f2a02fe0 d9b1cdd5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/13 18:58 linux-5.15.y 6139f2a02fe0 e66542d7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/13 14:48 linux-5.15.y 6139f2a02fe0 e66542d7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/10 22:38 linux-5.15.y 6139f2a02fe0 77b23aa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/10 11:15 linux-5.15.y 6139f2a02fe0 77b23aa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/09 21:10 linux-5.15.y 6139f2a02fe0 77b23aa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/09 16:13 linux-5.15.y 6139f2a02fe0 7f07e9b0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/08 21:56 linux-5.15.y 6139f2a02fe0 7f07e9b0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/07 05:01 linux-5.15.y 6139f2a02fe0 6404acf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/06 17:42 linux-5.15.y 6139f2a02fe0 6404acf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/06 00:21 linux-5.15.y 6139f2a02fe0 6404acf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/02 17:46 linux-5.15.y 6139f2a02fe0 60bf9982 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/02 03:31 linux-5.15.y 6139f2a02fe0 d61103fc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/01 15:16 linux-5.15.y 6139f2a02fe0 81024119 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/01 13:51 linux-5.15.y 6139f2a02fe0 81024119 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/01 05:51 linux-5.15.y 6139f2a02fe0 373b66cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/01/30 15:59 linux-5.15.y 6139f2a02fe0 7f400fcb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/01/30 11:12 linux-5.15.y 6139f2a02fe0 991a98f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/01/29 15:13 linux-5.15.y 6139f2a02fe0 991a98f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/01/29 12:23 linux-5.15.y 6139f2a02fe0 991a98f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/01/28 14:22 linux-5.15.y 6139f2a02fe0 cc4a4020 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/01/27 18:24 linux-5.15.y 6139f2a02fe0 cc4a4020 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/01/27 10:59 linux-5.15.y 6139f2a02fe0 cc4a4020 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/01/26 01:46 linux-5.15.y 6139f2a02fe0 cc4a4020 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/01/23 22:18 linux-5.15.y ddcaf4999061 1e153dc8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/01/23 18:46 linux-5.15.y ddcaf4999061 1e153dc8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/01/23 13:36 linux-5.15.y ddcaf4999061 1c0ecc51 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/02/22 18:26 linux-5.15.y 6139f2a02fe0 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/02/16 08:33 linux-5.15.y 6139f2a02fe0 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/02/14 09:43 linux-5.15.y 6139f2a02fe0 d902085f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/02/13 20:26 linux-5.15.y 6139f2a02fe0 e66542d7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/02/13 16:23 linux-5.15.y 6139f2a02fe0 e66542d7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/02/08 18:49 linux-5.15.y 6139f2a02fe0 7f07e9b0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/02/08 15:57 linux-5.15.y 6139f2a02fe0 7f07e9b0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/02/05 13:13 linux-5.15.y 6139f2a02fe0 e23e8c20 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/02/02 05:23 linux-5.15.y 6139f2a02fe0 d61103fc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/01/30 17:29 linux-5.15.y 6139f2a02fe0 7f400fcb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2023/03/11 19:42 linux-5.15.y d214f240b0f6 5205ef30 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
* Struck through repros no longer work on HEAD.