syzbot


possible deadlock in hfsplus_file_extend

Status: upstream: reported C repro on 2023/03/13 14:24
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+a9b05956c6ee2e5563cb@syzkaller.appspotmail.com
First crash: 349d, last: 2d07h
Bug presence (1)
Date Name Commit Repro Result
2023/12/28 upstream (ToT) f5837722ffec C [report] possible deadlock in hfsplus_file_extend
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 possible deadlock in hfsplus_file_extend hfsplus C 3 357d 423d 0/1 upstream: reported C repro on 2022/12/29 06:07
linux-5.15 possible deadlock in hfsplus_file_extend missing-backport origin:lts-only C 488 2d06h 351d 0/3 upstream: reported C repro on 2023/03/11 17:12
linux-4.19 possible deadlock in hfsplus_file_extend hfsplus C 258 356d 456d 0/1 upstream: reported C repro on 2022/11/26 10:00
upstream possible deadlock in hfsplus_file_extend hfs C error 8708 1h14m 456d 0/26 upstream: reported C repro on 2022/11/26 08:07

Sample crash report:
loop0: detected capacity change from 0 to 1024
======================================================
WARNING: possible circular locking dependency detected
6.1.69-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor122/3542 is trying to acquire lock:
ffff88807c1a07c8 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}, at: hfsplus_file_extend+0x1d2/0x1b10 fs/hfsplus/extents.c:457

but task is already holding lock:
ffff88807594e0b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_find_init+0x146/0x1c0

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&tree->tree_lock){+.+.}-{3:3}:
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
       __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
       handle_truncate fs/namei.c:3217 [inline]
       do_open fs/namei.c:3562 [inline]
       path_openat+0x27e2/0x2e60 fs/namei.c:3715
       do_filp_open+0x230/0x480 fs/namei.c:3742
       do_sys_openat2+0x13b/0x500 fs/open.c:1318
       __do_sys_openat2 fs/open.c:1375 [inline]
       __se_sys_openat2+0x237/0x2c0 fs/open.c:1353
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&HFSPLUS_I(inode)->extents_lock){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3090 [inline]
       check_prevs_add kernel/locking/lockdep.c:3209 [inline]
       validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825
       __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
       __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_renameat2 fs/namei.c:4969 [inline]
       __se_sys_renameat2 fs/namei.c:4966 [inline]
       __x64_sys_renameat2+0xce/0xe0 fs/namei.c:4966
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

4 locks held by syz-executor122/3542:
 #0: ffff888075948460 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:393
 #1: ffff88807c1a1e00 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline]
 #1: ffff88807c1a1e00 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: lock_rename+0xf6/0x1c0 fs/namei.c:2991
 #2: ffff88807c1a24c0 (&type->i_mutex_dir_key#6){++++}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline]
 #2: ffff88807c1a24c0 (&type->i_mutex_dir_key#6){++++}-{3:3}, at: lock_two_inodes+0xfc/0x180 fs/inode.c:1143
 #3: ffff88807594e0b0 (&tree->tree_lock){+.+.}-{3:3}, at: hfsplus_find_init+0x146/0x1c0

stack backtrace:
CPU: 1 PID: 3542 Comm: syz-executor122 Not tainted 6.1.69-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/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+0x1661/0x5950 kernel/locking/lockdep.c:3825
 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
 __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_renameat2 fs/namei.c:4969 [inline]
 __se_sys_renameat2 fs/namei.c:4966 [inline]
 __x64_sys_renameat2+0xce/0xe0 fs/namei.c:4966
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f3e429567b9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 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:00007ffd979920d8 EFLAGS: 00000246 ORIG_RAX: 000000000000013c
RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007f3e429567

Crashes (409):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/01/01 11:03 linux-6.1.y 4aa6747d9352 fb427a07 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2023/12/28 06:58 linux-6.1.y 4aa6747d9352 fb427a07 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/21 12:13 linux-6.1.y 8fd7f4462453 9bd8dcda .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_extend
2023/08/11 07:32 linux-6.1.y 0a4a7855302d da3c3ef8 .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_extend
2024/02/23 14:24 linux-6.1.y 81e1dc2f7001 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/20 09:28 linux-6.1.y 8b4118fabd6e 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/19 17:02 linux-6.1.y 8b4118fabd6e 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/16 09:59 linux-6.1.y f1bb70486c9c 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/15 13:42 linux-6.1.y f1bb70486c9c fd39cf6f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/15 11:01 linux-6.1.y f1bb70486c9c d9b1cdd5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/15 08:12 linux-6.1.y f1bb70486c9c d9b1cdd5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/13 19:18 linux-6.1.y f1bb70486c9c e66542d7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/13 00:15 linux-6.1.y f1bb70486c9c 77b23aa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/12 21:30 linux-6.1.y f1bb70486c9c 77b23aa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/12 07:33 linux-6.1.y f1bb70486c9c 77b23aa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/11 11:39 linux-6.1.y f1bb70486c9c 77b23aa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/10 10:43 linux-6.1.y f1bb70486c9c 77b23aa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/08 18:37 linux-6.1.y f1bb70486c9c 7f07e9b0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/07 19:17 linux-6.1.y f1bb70486c9c 6404acf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/05 23:19 linux-6.1.y f1bb70486c9c 6404acf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/05 15:46 linux-6.1.y e5c3b988b827 e23e8c20 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/05 13:23 linux-6.1.y e5c3b988b827 e23e8c20 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/31 16:57 linux-6.1.y 883d1a956208 373b66cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/31 13:04 linux-6.1.y 883d1a956208 373b66cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/31 10:18 linux-6.1.y 883d1a956208 373b66cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/30 13:26 linux-6.1.y 883d1a956208 7f400fcb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/30 10:56 linux-6.1.y 883d1a956208 991a98f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/30 01:39 linux-6.1.y 883d1a956208 991a98f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/29 16:43 linux-6.1.y 883d1a956208 991a98f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/26 16:34 linux-6.1.y 883d1a956208 cc4a4020 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/23 20:04 linux-6.1.y 8fd7f4462453 1e153dc8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/22 14:02 linux-6.1.y 8fd7f4462453 9bd8dcda .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/21 03:20 linux-6.1.y 8fd7f4462453 9bd8dcda .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/17 15:54 linux-6.1.y fec3b1451d5f c9a1c95b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/16 14:22 linux-6.1.y fec3b1451d5f 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/15 18:04 linux-6.1.y 7c58bfa711cb 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/13 17:29 linux-6.1.y 7c58bfa711cb 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/13 13:36 linux-6.1.y 7c58bfa711cb 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/06 05:26 linux-6.1.y 38fb82ecd144 d0304e9c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/05 17:08 linux-6.1.y 38fb82ecd144 28c42cff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/04 14:31 linux-6.1.y a507f147e6f0 28c42cff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/03 13:33 linux-6.1.y a507f147e6f0 fb427a07 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/01/01 19:02 linux-6.1.y a507f147e6f0 fb427a07 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in hfsplus_file_extend
2024/02/16 07:28 linux-6.1.y f1bb70486c9c 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_extend
2024/01/23 21:20 linux-6.1.y 8fd7f4462453 1e153dc8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_extend
2024/01/20 14:54 linux-6.1.y 8fd7f4462453 9bd8dcda .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_extend
2024/01/18 15:15 linux-6.1.y fec3b1451d5f 239abf84 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_extend
2024/01/18 14:04 linux-6.1.y fec3b1451d5f 239abf84 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_extend
2024/01/18 02:58 linux-6.1.y fec3b1451d5f 915053c7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_extend
2024/01/18 01:43 linux-6.1.y fec3b1451d5f 915053c7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_extend
2024/01/18 00:41 linux-6.1.y fec3b1451d5f 915053c7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_extend
2024/01/15 23:52 linux-6.1.y fec3b1451d5f 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_extend
2024/01/15 22:51 linux-6.1.y fec3b1451d5f 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_extend
2024/01/06 03:49 linux-6.1.y 38fb82ecd144 d0304e9c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_extend
2023/03/13 14:24 linux-6.1.y 6449a0ba6843 026e2200 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in hfsplus_file_extend
* Struck through repros no longer work on HEAD.