syzbot


possible deadlock in hfs_find_init

Status: upstream: reported C repro on 2022/12/30 06:08
Subsystems: hfs
[Documentation on labels]
Reported-by: syzbot+2558fca67e009a16ff7a@syzkaller.appspotmail.com
First crash: 476d, last: 410d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in hfs_find_init C error 11 1d14h 393d 0/3 upstream: reported C repro on 2023/03/22 23:14
linux-4.14 possible deadlock in hfs_find_init hfs C 1 416d 449d 0/1 upstream: reported C repro on 2023/01/26 19:14
upstream possible deadlock in hfs_find_init (2) hfs C error 160 1d15h 479d 0/26 upstream: reported C repro on 2022/12/27 00:59
linux-6.1 possible deadlock in hfs_find_init origin:upstream C 24 3d07h 396d 0/3 upstream: reported C repro on 2023/03/20 17:38
upstream possible deadlock in hfs_find_init hfs C done error 1 1198d 2188d 20/26 fixed on 2021/11/10 00:50

Sample crash report:
IPVS: ftp: loaded support on port[0] = 21
============================================
WARNING: possible recursive locking detected
4.19.211-syzkaller #0 Not tainted
--------------------------------------------
kworker/u4:4/1530 is trying to acquire lock:
000000008d64b6c6 (&tree->tree_lock/1){+.+.}, at: hfs_find_init+0x17e/0x230 fs/hfs/bfind.c:33

but task is already holding lock:
000000008d64b6c6 (&tree->tree_lock/1){+.+.}, at: hfs_find_init+0x17e/0x230 fs/hfs/bfind.c:33

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

       CPU0
       ----
  lock(&tree->tree_lock/1);
  lock(&tree->tree_lock/1);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

4 locks held by kworker/u4:4/1530:
 #0: 00000000a9ed9130 ((wq_completion)"writeback"){+.+.}, at: process_one_work+0x767/0x1570 kernel/workqueue.c:2124
 #1: 00000000dc3b79d5 ((work_completion)(&(&wb->dwork)->work)){+.+.}, at: process_one_work+0x79c/0x1570 kernel/workqueue.c:2128
 #2: 000000008d64b6c6 (&tree->tree_lock/1){+.+.}, at: hfs_find_init+0x17e/0x230 fs/hfs/bfind.c:33
 #3: 0000000083ad5da7 (&HFS_I(tree->inode)->extents_lock){+.+.}, at: hfs_extend_file+0x93/0xac0 fs/hfs/extent.c:397

stack backtrace:
CPU: 1 PID: 1530 Comm: kworker/u4:4 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
Workqueue: writeback wb_workfn (flush-7:0)
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
 hfs_find_init+0x17e/0x230 fs/hfs/bfind.c:33
 hfs_ext_read_extent+0x191/0xa20 fs/hfs/extent.c:200
 hfs_extend_file+0x4a0/0xac0 fs/hfs/extent.c:401
 hfs_bmap_reserve+0x241/0x390 fs/hfs/btree.c:231
 __hfs_ext_write_extent+0x3c1/0x510 fs/hfs/extent.c:121
 hfs_ext_write_extent fs/hfs/extent.c:144 [inline]
 hfs_ext_write_extent+0x1a2/0x1f0 fs/hfs/extent.c:135
 hfs_write_inode+0x8f/0x930 fs/hfs/inode.c:426
 write_inode fs/fs-writeback.c:1244 [inline]
 __writeback_single_inode+0x733/0x11d0 fs/fs-writeback.c:1442
 writeback_sb_inodes+0x537/0xef0 fs/fs-writeback.c:1647
 wb_writeback+0x28d/0xcc0 fs/fs-writeback.c:1820
 wb_do_writeback fs/fs-writeback.c:1965 [inline]
 wb_workfn+0x29b/0x1250 fs/fs-writeback.c:2006
 process_one_work+0x864/0x1570 kernel/workqueue.c:2153
 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296
 kthread+0x33f/0x460 kernel/kthread.c:259
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/01/29 05:40 linux-4.19.y 3f8a27f9e27b 9dfcf09c .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 possible deadlock in hfs_find_init
2023/03/05 21:46 linux-4.19.y 3f8a27f9e27b f8902b57 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfs_find_init
2023/01/13 11:02 linux-4.19.y 3f8a27f9e27b 96166539 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfs_find_init
2023/01/10 15:43 linux-4.19.y 3f8a27f9e27b 48bc529a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfs_find_init
2023/01/08 09:33 linux-4.19.y 3f8a27f9e27b 1dac8c7a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfs_find_init
2023/01/08 03:37 linux-4.19.y 3f8a27f9e27b 1dac8c7a .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfs_find_init
2022/12/30 06:08 linux-4.19.y 3f8a27f9e27b 44712fbc .config console log report info [disk image] [vmlinux] ci2-linux-4-19 possible deadlock in hfs_find_init
* Struck through repros no longer work on HEAD.