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: 559d, last: 32d
Bug presence (3)
Date Name Commit Repro Result
2024/07/21 linux-5.15.y (ToT) 7c6d66f0266f C [report] possible deadlock in hfsplus_file_truncate
2024/02/07 upstream (ToT) 6d280f4d760e C [report] possible deadlock in hfsplus_file_truncate
2024/07/21 upstream (ToT) 2c9b3512402e 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 38d 664d 27/28 fixed on 2024/08/14 03:44
linux-6.1 possible deadlock in hfsplus_file_truncate missing-backport origin:lts-only C 4262 13d 555d 0/3 upstream: reported C repro on 2023/03/15 11:18
linux-4.19 possible deadlock in hfsplus_file_truncate hfsplus C 165 564d 663d 0/1 upstream: reported C repro on 2022/11/27 09:20
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2024/08/20 03:41 10h05m fix candidate upstream OK (4) job log
2023/12/27 03:07 0m fix candidate upstream error job log
2023/11/23 23:05 0m fix candidate upstream error job 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 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 (5300):
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
2024/06/06 22:23 linux-5.15.y c61bd26ae81a 121701b6 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/05/17 02:51 linux-5.15.y 284087d4f7d5 c2e07261 .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/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/08/19 01:17 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/18 17:27 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/18 05:27 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/18 01:59 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/17 09:29 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/17 08:17 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/17 07:15 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/17 06:08 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/17 05:09 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/17 00:18 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/16 18:38 linux-5.15.y 7e89efd3ae1c e1c76ab2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/16 17:36 linux-5.15.y 7e89efd3ae1c e1c76ab2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/16 17:28 linux-5.15.y 7e89efd3ae1c e1c76ab2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/16 15:23 linux-5.15.y 7e89efd3ae1c e1c76ab2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/16 14:21 linux-5.15.y 7e89efd3ae1c e1c76ab2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/16 11:57 linux-5.15.y 7e89efd3ae1c e1c76ab2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/16 11:57 linux-5.15.y 7e89efd3ae1c e1c76ab2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/16 00:29 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/15 13:09 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/15 10:36 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/15 10:29 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/15 09:25 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/15 08:04 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/15 07:36 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/15 03:19 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/14 23:06 linux-5.15.y 7e89efd3ae1c e6b88e20 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/14 20:48 linux-5.15.y 7e89efd3ae1c e6b88e20 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/14 19:56 linux-5.15.y 7e89efd3ae1c e6b88e20 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/14 18:13 linux-5.15.y 7e89efd3ae1c e6b88e20 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/14 17:53 linux-5.15.y 7e89efd3ae1c e6b88e20 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/14 13:11 linux-5.15.y 7e89efd3ae1c 07a4d4ad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/14 12:11 linux-5.15.y 7e89efd3ae1c 07a4d4ad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/14 09:59 linux-5.15.y 7e89efd3ae1c 07a4d4ad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/14 09:11 linux-5.15.y 7e89efd3ae1c 07a4d4ad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/14 07:14 linux-5.15.y 7e89efd3ae1c bde81f6f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/14 06:12 linux-5.15.y 7e89efd3ae1c bde81f6f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/14 04:54 linux-5.15.y 7e89efd3ae1c bde81f6f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/14 03:19 linux-5.15.y 7e89efd3ae1c bde81f6f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in hfsplus_file_truncate
2024/08/19 03:49 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/19 02:28 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/18 19:14 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/18 15:48 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/18 14:47 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/18 00:00 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/17 18:52 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/17 16:56 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/16 09:26 linux-5.15.y 7e89efd3ae1c e1c76ab2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/15 11:45 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/15 04:27 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in hfsplus_file_truncate
2024/08/14 15:23 linux-5.15.y 7e89efd3ae1c e6b88e20 .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.