syzbot


possible deadlock in hfsplus_get_block

Status: upstream: reported C repro on 2022/11/26 01:19
Reported-by: syzbot+3e6540b68637216b8a31@syzkaller.appspotmail.com
First crash: 74d, last: 1d06h
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 possible deadlock in hfsplus_get_block hfsplus C 96 6h48m 70d 0/1 upstream: reported C repro on 2022/11/30 01:33
upstream possible deadlock in hfsplus_get_block hfsplus C error 1040 1h19m 74d 0/24 upstream: reported C repro on 2022/11/25 09:45

Sample crash report:
hfsplus: xattr searching failed
============================================
WARNING: possible recursive locking detected
4.19.211-syzkaller #0 Not tainted
--------------------------------------------
syz-executor293/8072 is trying to acquire lock:
000000002345367d (&HFSPLUS_I(inode)->extents_lock){+.+.}, at: hfsplus_get_block+0x292/0x960 fs/hfsplus/extents.c:260

but task is already holding lock:
000000005ad27fe3 (&HFSPLUS_I(inode)->extents_lock){+.+.}, at: hfsplus_file_truncate+0x1e2/0x1040 fs/hfsplus/extents.c:576

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&HFSPLUS_I(inode)->extents_lock);
  lock(&HFSPLUS_I(inode)->extents_lock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

4 locks held by syz-executor293/8072:
 #0: 00000000bca0d5fc (sb_writers#11){.+.+}, at: sb_start_write include/linux/fs.h:1579 [inline]
 #0: 00000000bca0d5fc (sb_writers#11){.+.+}, at: mnt_want_write+0x3a/0xb0 fs/namespace.c:360
 #1: 0000000078f46c11 (&sb->s_type->i_mutex_key#17){+.+.}, at: inode_lock include/linux/fs.h:748 [inline]
 #1: 0000000078f46c11 (&sb->s_type->i_mutex_key#17){+.+.}, at: do_truncate+0x125/0x1f0 fs/open.c:61
 #2: 000000005ad27fe3 (&HFSPLUS_I(inode)->extents_lock){+.+.}, at: hfsplus_file_truncate+0x1e2/0x1040 fs/hfsplus/extents.c:576
 #3: 00000000c81062c5 (&sbi->alloc_mutex){+.+.}, at: hfsplus_block_free+0xdb/0x5d0 fs/hfsplus/bitmap.c:182

stack backtrace:
CPU: 0 PID: 8072 Comm: syz-executor293 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 print_deadlock_bug kernel/locking/lockdep.c:1764 [inline]
 check_deadlock kernel/locking/lockdep.c:1808 [inline]
 validate_chain kernel/locking/lockdep.c:2404 [inline]
 __lock_acquire.cold+0x121/0x57e kernel/locking/lockdep.c:3416
 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908
 __mutex_lock_common kernel/locking/mutex.c:937 [inline]
 __mutex_lock+0xd7/0x1190 kernel/locking/mutex.c:1078
 hfsplus_get_block+0x292/0x960 fs/hfsplus/extents.c:260
 block_read_full_page+0x288/0xd10 fs/buffer.c:2259
 do_read_cache_page+0x533/0x1170 mm/filemap.c:2828
 read_mapping_page include/linux/pagemap.h:402 [inline]
 hfsplus_block_free+0x18b/0x5d0 fs/hfsplus/bitmap.c:185
 hfsplus_free_extents+0x228/0x520 fs/hfsplus/extents.c:363
 hfsplus_file_truncate+0xd96/0x1040 fs/hfsplus/extents.c:591
 hfsplus_setattr+0x1e7/0x310 fs/hfsplus/inode.c:263
 notify_change+0x70b/0xfc0 fs/attr.c:334
 do_truncate+0x134/0x1f0 fs/open.c:63
 handle_truncate fs/namei.c:3009 [inline]
 do_last fs/namei.c:3427 [inline]
 path_openat+0x2308/0x2df0 fs/namei.c:3537
 do_filp_open+0x18c/0x3f0 fs/namei.c:3567
 do_sys_open+0x3b3/0x520 fs/open.c:1085
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7faa0cf3e789
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc19f1d098 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007faa0cf3e789
RDX: 00007faa0cefce03 RSI: 0000000000000000 RDI: 00000000200000c0
RBP: 00007faa0cefe020 R08: 00000000000005e1 R09: 0000000000000000
R10: 00007ffc19f1cf60 R11: 0000000000000246 R12: 00007faa0cefe0b0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
hfsplus: unable to mark blocks free: error -5
hfsplus: can't fre

Crashes (188):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci2-linux-4-19 2023/01/01 19:43 linux-4.19.y 3f8a27f9e27b ab32d508 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/01 07:10 linux-4.19.y 3f8a27f9e27b ab32d508 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/31 19:58 linux-4.19.y 3f8a27f9e27b ab32d508 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/30 19:56 linux-4.19.y 3f8a27f9e27b 44712fbc .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/29 13:55 linux-4.19.y 3f8a27f9e27b 44712fbc .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/26 09:27 linux-4.19.y 3f8a27f9e27b 9da18ae8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/25 13:12 linux-4.19.y 3f8a27f9e27b 9da18ae8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/24 05:23 linux-4.19.y 3f8a27f9e27b 9da18ae8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/24 02:10 linux-4.19.y 3f8a27f9e27b 9da18ae8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/22 19:32 linux-4.19.y 3f8a27f9e27b 9da18ae8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/22 04:00 linux-4.19.y 3f8a27f9e27b 4067838e .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/19 04:57 linux-4.19.y 3f8a27f9e27b 05494336 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/17 20:23 linux-4.19.y 3f8a27f9e27b 05494336 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/17 08:44 linux-4.19.y 3f8a27f9e27b 05494336 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/17 08:32 linux-4.19.y 3f8a27f9e27b 05494336 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/15 08:56 linux-4.19.y 3f8a27f9e27b b18f0a64 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/12 21:17 linux-4.19.y 3f8a27f9e27b 67be1ae7 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/12 14:05 linux-4.19.y 3f8a27f9e27b 67be1ae7 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/11 07:52 linux-4.19.y 3f8a27f9e27b 67be1ae7 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/09 02:39 linux-4.19.y 3f8a27f9e27b 1034e5fa .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/08 22:57 linux-4.19.y 3f8a27f9e27b 1034e5fa .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/08 14:41 linux-4.19.y 3f8a27f9e27b d88f3abb .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/07 18:53 linux-4.19.y 3f8a27f9e27b d88f3abb .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/06 14:26 linux-4.19.y 3f8a27f9e27b 045cbb84 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/05 07:41 linux-4.19.y 3f8a27f9e27b e080de16 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/04 05:10 linux-4.19.y 3f8a27f9e27b e080de16 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/03 20:21 linux-4.19.y 3f8a27f9e27b e080de16 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/02 05:52 linux-4.19.y 3f8a27f9e27b e080de16 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/02 05:41 linux-4.19.y 3f8a27f9e27b e080de16 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/02 05:30 linux-4.19.y 3f8a27f9e27b e080de16 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/01 22:35 linux-4.19.y 3f8a27f9e27b e080de16 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/12/01 13:18 linux-4.19.y 3f8a27f9e27b 4c2a66e8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/11/29 14:30 linux-4.19.y 3f8a27f9e27b ca9683b8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/11/26 01:18 linux-4.19.y 3f8a27f9e27b f4470a7b .config console log report syz C [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2022/11/30 00:45 linux-4.19.y 3f8a27f9e27b 579a3740 .config console log report syz [disk image] [vmlinux] [mounted in repro] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/02/06 19:20 linux-4.19.y 3f8a27f9e27b 0a9c11b6 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/02/06 12:08 linux-4.19.y 3f8a27f9e27b be607b78 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/02/06 10:42 linux-4.19.y 3f8a27f9e27b be607b78 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/02/05 17:24 linux-4.19.y 3f8a27f9e27b be607b78 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/02/04 20:35 linux-4.19.y 3f8a27f9e27b be607b78 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/02/04 16:30 linux-4.19.y 3f8a27f9e27b be607b78 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/02/04 10:03 linux-4.19.y 3f8a27f9e27b 1b2f701a .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/02/04 08:54 linux-4.19.y 3f8a27f9e27b 1b2f701a .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/02/03 20:08 linux-4.19.y 3f8a27f9e27b 1b2f701a .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/02/03 08:41 linux-4.19.y 3f8a27f9e27b 33fc5c09 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/02/03 06:27 linux-4.19.y 3f8a27f9e27b 33fc5c09 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/02/03 00:18 linux-4.19.y 3f8a27f9e27b 16d19e30 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/02/02 22:13 linux-4.19.y 3f8a27f9e27b 16d19e30 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/02/02 17:24 linux-4.19.y 3f8a27f9e27b 16d19e30 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/02/02 03:43 linux-4.19.y 3f8a27f9e27b 9a6f477c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/31 16:14 linux-4.19.y 3f8a27f9e27b b68fb8d6 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/30 09:52 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/29 14:22 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/28 21:48 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/28 19:07 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/28 14:13 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/28 06:36 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/28 05:21 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/27 13:53 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/27 09:40 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/27 07:35 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/27 02:01 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/26 23:17 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/26 11:55 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/24 22:57 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/24 20:53 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/23 19:11 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/23 10:50 linux-4.19.y 3f8a27f9e27b 44388686 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/22 22:47 linux-4.19.y 3f8a27f9e27b cc0f9968 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/22 18:01 linux-4.19.y 3f8a27f9e27b cc0f9968 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/21 15:09 linux-4.19.y 3f8a27f9e27b cc0f9968 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/21 11:11 linux-4.19.y 3f8a27f9e27b cc0f9968 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/20 10:12 linux-4.19.y 3f8a27f9e27b dd15ff29 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/20 00:50 linux-4.19.y 3f8a27f9e27b 71197f3a .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/19 05:46 linux-4.19.y 3f8a27f9e27b 4620c2d9 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/18 22:17 linux-4.19.y 3f8a27f9e27b 4620c2d9 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/17 18:40 linux-4.19.y 3f8a27f9e27b 42660d9e .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/17 13:15 linux-4.19.y 3f8a27f9e27b a63719e7 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/16 01:51 linux-4.19.y 3f8a27f9e27b a63719e7 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/15 13:33 linux-4.19.y 3f8a27f9e27b a63719e7 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/14 06:25 linux-4.19.y 3f8a27f9e27b 529798b0 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/13 13:25 linux-4.19.y 3f8a27f9e27b 96166539 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
ci2-linux-4-19 2023/01/12 18:05 linux-4.19.y 3f8a27f9e27b 96166539 .config console log report info [disk image] [vmlinux] possible deadlock in hfsplus_get_block
* Struck through repros no longer work on HEAD.