syzbot


possible deadlock in hfsplus_get_block

Status: upstream: reported C repro on 2022/11/26 01:19
Subsystems: hfsplus
[Documentation on labels]
Reported-by: syzbot+3e6540b68637216b8a31@syzkaller.appspotmail.com
First crash: 682d, last: 581d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in hfsplus_get_block origin:upstream C 1092 46m 574d 0/3 upstream: reported C repro on 2023/03/14 12:03
linux-4.14 possible deadlock in hfsplus_get_block hfsplus C 131 587d 678d 0/1 upstream: reported C repro on 2022/11/30 01:33
linux-6.1 possible deadlock in hfsplus_get_block origin:lts-only C 947 7d17h 575d 0/3 upstream: reported C repro on 2023/03/13 14:59
upstream possible deadlock in hfsplus_get_block hfs C error 11216 51m 683d 0/28 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 (248):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/01/01 19:43 linux-4.19.y 3f8a27f9e27b ab32d508 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/01/01 07:10 linux-4.19.y 3f8a27f9e27b ab32d508 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/31 19:58 linux-4.19.y 3f8a27f9e27b ab32d508 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/30 19:56 linux-4.19.y 3f8a27f9e27b 44712fbc .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/29 13:55 linux-4.19.y 3f8a27f9e27b 44712fbc .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/26 09:27 linux-4.19.y 3f8a27f9e27b 9da18ae8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/25 13:12 linux-4.19.y 3f8a27f9e27b 9da18ae8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/24 05:23 linux-4.19.y 3f8a27f9e27b 9da18ae8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/24 02:10 linux-4.19.y 3f8a27f9e27b 9da18ae8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/22 19:32 linux-4.19.y 3f8a27f9e27b 9da18ae8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/22 04:00 linux-4.19.y 3f8a27f9e27b 4067838e .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/19 04:57 linux-4.19.y 3f8a27f9e27b 05494336 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/17 20:23 linux-4.19.y 3f8a27f9e27b 05494336 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/17 08:44 linux-4.19.y 3f8a27f9e27b 05494336 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/17 08:32 linux-4.19.y 3f8a27f9e27b 05494336 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/15 08:56 linux-4.19.y 3f8a27f9e27b b18f0a64 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/12 21:17 linux-4.19.y 3f8a27f9e27b 67be1ae7 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/12 14:05 linux-4.19.y 3f8a27f9e27b 67be1ae7 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/11 07:52 linux-4.19.y 3f8a27f9e27b 67be1ae7 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/09 02:39 linux-4.19.y 3f8a27f9e27b 1034e5fa .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/08 22:57 linux-4.19.y 3f8a27f9e27b 1034e5fa .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/08 14:41 linux-4.19.y 3f8a27f9e27b d88f3abb .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/07 18:53 linux-4.19.y 3f8a27f9e27b d88f3abb .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/06 14:26 linux-4.19.y 3f8a27f9e27b 045cbb84 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/05 07:41 linux-4.19.y 3f8a27f9e27b e080de16 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/04 05:10 linux-4.19.y 3f8a27f9e27b e080de16 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/03 20:21 linux-4.19.y 3f8a27f9e27b e080de16 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/02 05:52 linux-4.19.y 3f8a27f9e27b e080de16 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/02 05:41 linux-4.19.y 3f8a27f9e27b e080de16 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/02 05:30 linux-4.19.y 3f8a27f9e27b e080de16 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/01 22:35 linux-4.19.y 3f8a27f9e27b e080de16 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/12/01 13:18 linux-4.19.y 3f8a27f9e27b 4c2a66e8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/11/29 14:30 linux-4.19.y 3f8a27f9e27b ca9683b8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/11/26 01:18 linux-4.19.y 3f8a27f9e27b f4470a7b .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2022/11/30 00:45 linux-4.19.y 3f8a27f9e27b 579a3740 .config console log report syz [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/07 06:02 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/06 19:26 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/06 14:56 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/06 13:52 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/05 16:08 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/05 01:38 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/04 23:39 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/04 17:59 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/03 20:16 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/03 16:12 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/03 11:13 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/03 09:40 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/02 23:58 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/02 18:18 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/02 16:20 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/01 06:31 linux-4.19.y 3f8a27f9e27b 95aee97a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/03/01 01:07 linux-4.19.y 3f8a27f9e27b 95aee97a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/27 14:23 linux-4.19.y 3f8a27f9e27b 9189cb53 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/25 20:28 linux-4.19.y 3f8a27f9e27b ee50e71c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/25 13:31 linux-4.19.y 3f8a27f9e27b ee50e71c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/24 19:47 linux-4.19.y 3f8a27f9e27b ee50e71c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/24 13:58 linux-4.19.y 3f8a27f9e27b ee50e71c .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/23 04:13 linux-4.19.y 3f8a27f9e27b 9f1e2cb3 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/23 02:46 linux-4.19.y 3f8a27f9e27b 9f1e2cb3 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/22 22:51 linux-4.19.y 3f8a27f9e27b 9f1e2cb3 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/22 15:01 linux-4.19.y 3f8a27f9e27b 9f1e2cb3 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/22 03:20 linux-4.19.y 3f8a27f9e27b 42a4d508 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/21 16:24 linux-4.19.y 3f8a27f9e27b f949448d .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/21 13:43 linux-4.19.y 3f8a27f9e27b f949448d .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/20 15:59 linux-4.19.y 3f8a27f9e27b bcdf85f8 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/20 10:28 linux-4.19.y 3f8a27f9e27b bcdf85f8 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/20 08:54 linux-4.19.y 3f8a27f9e27b bcdf85f8 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/19 23:45 linux-4.19.y 3f8a27f9e27b bcdf85f8 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/19 17:13 linux-4.19.y 3f8a27f9e27b bcdf85f8 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/19 03:38 linux-4.19.y 3f8a27f9e27b bcdf85f8 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/18 23:31 linux-4.19.y 3f8a27f9e27b bcdf85f8 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/18 15:43 linux-4.19.y 3f8a27f9e27b d02e9a70 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/18 05:30 linux-4.19.y 3f8a27f9e27b d02e9a70 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/17 18:19 linux-4.19.y 3f8a27f9e27b cf8c2d39 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/16 00:42 linux-4.19.y 3f8a27f9e27b 6be0f1f5 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/14 16:52 linux-4.19.y 3f8a27f9e27b 93ae7e0a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/14 12:46 linux-4.19.y 3f8a27f9e27b 93ae7e0a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/14 06:40 linux-4.19.y 3f8a27f9e27b 93ae7e0a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/14 05:24 linux-4.19.y 3f8a27f9e27b 93ae7e0a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/14 02:00 linux-4.19.y 3f8a27f9e27b 93ae7e0a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/13 08:47 linux-4.19.y 3f8a27f9e27b 93e26d60 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
2023/02/12 05:23 linux-4.19.y 3f8a27f9e27b 93e26d60 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfsplus_get_block
* Struck through repros no longer work on HEAD.