syzbot


possible deadlock in hfsplus_file_truncate

Status: auto-obsoleted due to no activity on 2024/10/28 04:09
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+c9d1923ec3044ae3609c@syzkaller.appspotmail.com
First crash: 620d, last: 94d
Bug presence (1)
Date Name Commit Repro Result
2024/10/10 upstream (ToT) d3d1556696c1 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 99d 726d 27/28 fixed on 2024/08/14 03:44
linux-6.1 possible deadlock in hfsplus_file_truncate missing-backport origin:lts-only C error 4262 74d 617d 0/3 upstream: reported C repro on 2023/03/15 11:18
linux-4.19 possible deadlock in hfsplus_file_truncate hfsplus C 165 625d 725d 0/1 upstream: reported C repro on 2022/11/27 09:20
Last patch testing requests (4)
Created Duration User Patch Repo Result
2024/10/08 12:33 16m retest repro linux-5.15.y OK log
2024/10/08 12:33 19m retest repro linux-5.15.y OK log
2024/10/08 12:33 22m retest repro linux-5.15.y OK log
2024/10/08 12:33 17m retest repro linux-5.15.y OK log
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:
loop2: detected capacity change from 0 to 1024
======================================================
WARNING: possible circular locking dependency detected
5.15.164-syzkaller #0 Not tainted
------------------------------------------------------
syz.2.944/6773 is trying to acquire lock:
ffff8880155d00b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x864/0xb80 fs/hfsplus/extents.c:595

but task is already holding lock:
ffff8880642d2988 (&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_create_cat+0x1a9/0x1ba0 fs/hfsplus/catalog.c:272
       hfsplus_fill_super+0x13e6/0x1c90 fs/hfsplus/super.c:560
       mount_bdev+0x2c9/0x3f0 fs/super.c:1387
       legacy_get_tree+0xeb/0x180 fs/fs_context.c:611
       vfs_get_tree+0x88/0x270 fs/super.c:1517
       do_new_mount+0x2ba/0xb40 fs/namespace.c:3005
       do_mount fs/namespace.c:3348 [inline]
       __do_sys_mount fs/namespace.c:3556 [inline]
       __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3533
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #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_file_release+0xf3/0x3e0 fs/hfsplus/inode.c:236
       __fput+0x3fe/0x8e0 fs/file_table.c:280
       task_work_run+0x129/0x1a0 kernel/task_work.c:164
       tracehook_notify_resume include/linux/tracehook.h:189 [inline]
       exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181
       exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
       __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
       syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307
       do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

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 ***

2 locks held by syz.2.944/6773:
 #0: ffff8880642d2b80 (&sb->s_type->i_mutex_key#32){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
 #0: ffff8880642d2b80 (&sb->s_type->i_mutex_key#32){+.+.}-{3:3}, at: hfsplus_file_release+0xeb/0x3e0 fs/hfsplus/inode.c:235
 #1: ffff8880642d2988 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_truncate+0x2e1/0xb80 fs/hfsplus/extents.c:576

stack backtrace:
CPU: 1 PID: 6773 Comm: syz.2.944 Not tainted 5.15.164-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 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_file_release+0xf3/0x3e0 fs/hfsplus/inode.c:236
 __fput+0x3fe/0x8e0 fs/file_table.c:280
 task_work_run+0x129/0x1a0 kernel/task_work.c:164
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
 syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307
 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f572679be79
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:00007f5724c18038 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 00007f5726937f80 RCX: 00007f572679be79
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 00007f5726809916 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f5726937f80 R15: 00007ffed75e4868
 </TASK>

Crashes (5300):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
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/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/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
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
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
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/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.