syzbot


possible deadlock in flush_workqueue (3)

Status: upstream: reported on 2024/11/29 11:46
Reported-by: syzbot+9412cc722abc337b4880@syzkaller.appspotmail.com
First crash: 22d, last: 13h40m
Similar bugs (8)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in flush_workqueue 1 619d 619d 0/3 auto-obsoleted due to no activity on 2023/08/09 18:38
android-414 possible deadlock in flush_workqueue 1 1867d 1867d 0/1 auto-closed as invalid on 2020/03/10 11:29
linux-5.15 possible deadlock in flush_workqueue (2) origin:lts-only syz inconclusive 51 148d 282d 0/3 auto-obsoleted due to no activity on 2024/10/05 10:09
upstream possible deadlock in flush_workqueue (2) C done done 256 1820d 2253d 15/28 fixed on 2020/01/31 18:49
linux-4.14 possible deadlock in flush_workqueue C done 15 1860d 1953d 1/1 fixed on 2019/12/18 17:48
linux-4.14 possible deadlock in flush_workqueue (2) 3 1823d 1828d 0/1 auto-closed as invalid on 2020/04/22 20:54
upstream possible deadlock in flush_workqueue net C 73762 2269d 2312d 11/28 fixed on 2018/10/11 14:33
linux-4.19 possible deadlock in flush_workqueue 3 1881d 1892d 0/1 auto-closed as invalid on 2020/02/25 05:02

Sample crash report:
gfs2: fsid=syz:syz.0: about to withdraw this file system
============================================
WARNING: possible recursive locking detected
5.15.174-syzkaller #0 Not tainted
--------------------------------------------
kworker/0:6/4216 is trying to acquire lock:
ffff88801ee6c938 ((wq_completion)delete_workqueue){+.+.}-{0:0}, at: flush_workqueue+0x154/0x1610 kernel/workqueue.c:2830

but task is already holding lock:
ffff88801ee6c938 ((wq_completion)delete_workqueue){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2283

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

       CPU0
       ----
  lock((wq_completion)delete_workqueue);
  lock((wq_completion)delete_workqueue);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

2 locks held by kworker/0:6/4216:
 #0: ffff88801ee6c938 ((wq_completion)delete_workqueue){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2283
 #1: ffffc900031dfd20 ((work_completion)(&(&gl->gl_delete)->work)){+.+.}-{0:0}, at: process_one_work+0x7d0/0x10c0 kernel/workqueue.c:2285

stack backtrace:
CPU: 0 PID: 4216 Comm: kworker/0:6 Not tainted 5.15.174-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024
Workqueue: delete_workqueue delete_work_func
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 print_deadlock_bug kernel/locking/lockdep.c:2946 [inline]
 check_deadlock kernel/locking/lockdep.c:2989 [inline]
 validate_chain+0x46d2/0x5930 kernel/locking/lockdep.c:3775
 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
 flush_workqueue+0x170/0x1610 kernel/workqueue.c:2830
 gfs2_make_fs_ro+0xd1/0x5f0 fs/gfs2/super.c:529
 signal_our_withdraw fs/gfs2/util.c:166 [inline]
 gfs2_withdraw+0x5fb/0x14e0 fs/gfs2/util.c:343
 gfs2_meta_check_ii+0x6e/0x80 fs/gfs2/util.c:498
 gfs2_metatype_check_i fs/gfs2/util.h:126 [inline]
 gfs2_meta_buffer+0x324/0x410 fs/gfs2/meta_io.c:493
 gfs2_meta_inode_buffer fs/gfs2/meta_io.h:70 [inline]
 gfs2_inode_refresh+0xdd/0x1070 fs/gfs2/glops.c:481
 gfs2_inode_lookup+0x86e/0xd10 fs/gfs2/inode.c:199
 gfs2_lookup_by_inum+0x4d/0xe0 fs/gfs2/inode.c:250
 delete_work_func+0x172/0x560 fs/gfs2/glock.c:1004
 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
 kthread+0x3f6/0x4f0 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
 </TASK>

Crashes (18):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/18 23:10 linux-5.15.y 963e654022cc a0626d3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in flush_workqueue
2024/12/18 01:26 linux-5.15.y 963e654022cc a0626d3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in flush_workqueue
2024/12/17 14:48 linux-5.15.y 963e654022cc f93b2b55 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in flush_workqueue
2024/12/14 06:32 linux-5.15.y 0a51d2d4527b 7cbfbb3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in flush_workqueue
2024/12/08 21:46 linux-5.15.y 0a51d2d4527b 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in flush_workqueue
2024/12/08 21:44 linux-5.15.y 0a51d2d4527b 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in flush_workqueue
2024/11/30 13:02 linux-5.15.y 0a51d2d4527b 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in flush_workqueue
2024/12/21 02:28 linux-5.15.y 91786f140358 d7f584ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in flush_workqueue
2024/12/20 22:01 linux-5.15.y 91786f140358 0f61b415 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in flush_workqueue
2024/12/19 22:47 linux-5.15.y 91786f140358 5905cb39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in flush_workqueue
2024/12/19 06:57 linux-5.15.y 963e654022cc 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in flush_workqueue
2024/12/17 13:34 linux-5.15.y 963e654022cc f93b2b55 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in flush_workqueue
2024/12/10 05:30 linux-5.15.y 0a51d2d4527b cfc402b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in flush_workqueue
2024/12/10 05:28 linux-5.15.y 0a51d2d4527b cfc402b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in flush_workqueue
2024/12/10 05:28 linux-5.15.y 0a51d2d4527b cfc402b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in flush_workqueue
2024/12/09 21:53 linux-5.15.y 0a51d2d4527b 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in flush_workqueue
2024/11/30 08:53 linux-5.15.y 0a51d2d4527b 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in flush_workqueue
2024/11/29 11:45 linux-5.15.y 0a51d2d4527b 5df23865 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in flush_workqueue
* Struck through repros no longer work on HEAD.