bisecting fixing commit since 3dd0130f2430decf0cb001b452824515436986d2 building syzkaller on 4a77ae0bdc5cd75ebe88ce7c896aae6bbf457a29 testing commit 3dd0130f2430decf0cb001b452824515436986d2 with gcc (GCC) 8.4.1 20210217 kernel signature: 3558e384fc72b5056753c2b3f997162e87ca07c3602cb5e17feff1b3d3555dd7 all runs: crashed: INFO: task hung in sync_inodes_sb testing current HEAD 17ae69aba89dbfa2139b7f8024b757ab3cc42f59 testing commit 17ae69aba89dbfa2139b7f8024b757ab3cc42f59 with gcc (GCC) 10.2.1 20210217 kernel signature: 2e4ac03b54b086b02ae3f7b8d759a07531400a4c55eb2e67bdbb65f8fdbc2b2c all runs: crashed: INFO: task hung in sync_inodes_sb revisions tested: 2, total time: 28m36.055117763s (build: 13m31.054460109s, test: 14m6.367776952s) the crash still happens on HEAD commit msg: Merge tag 'landlock_v34' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security crash: INFO: task hung in sync_inodes_sb INFO: task syz-executor.2:6119 blocked for more than 143 seconds. Not tainted 5.12.0-syzkaller #0 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:syz-executor.2 state:D stack:24224 pid: 6119 ppid: 6114 flags:0x00004000 Call Trace: context_switch kernel/sched/core.c:4339 [inline] __schedule+0xfd1/0x2550 kernel/sched/core.c:5147 schedule+0xcf/0x270 kernel/sched/core.c:5226 wb_wait_for_completion+0x15a/0x200 fs/fs-writeback.c:209 sync_inodes_sb+0x18b/0x8a0 fs/fs-writeback.c:2577 __sync_filesystem fs/sync.c:34 [inline] sync_filesystem fs/sync.c:67 [inline] sync_filesystem+0x10b/0x1f0 fs/sync.c:48 generic_shutdown_super+0x64/0x330 fs/super.c:448 kill_block_super+0x90/0xd0 fs/super.c:1395 deactivate_locked_super+0x7b/0x130 fs/super.c:335 cleanup_mnt+0x324/0x4d0 fs/namespace.c:1136 task_work_run+0xc0/0x160 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:174 [inline] exit_to_user_mode_prepare+0x26c/0x280 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x40/0x80 kernel/entry/common.c:301 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:57 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x466ca7 RSP: 002b:00007ffeb1bbe7c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000466ca7 RDX: 00007ffeb1bbe899 RSI: 0000000000000002 RDI: 00007ffeb1bbe890 RBP: 00007ffeb1bbe890 R08: 00000000ffffffff R09: 00007ffeb1bbe660 R10: 000000000282d8e3 R11: 0000000000000246 R12: 00000000004ae4c5 R13: 00007ffeb1bbf940 R14: 000000000282d810 R15: 0000000000000002 INFO: task syz-executor.0:6121 blocked for more than 143 seconds. Not tainted 5.12.0-syzkaller #0 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:syz-executor.0 state:D stack:23832 pid: 6121 ppid: 1 flags:0x00004004 Call Trace: context_switch kernel/sched/core.c:4339 [inline] __schedule+0xfd1/0x2550 kernel/sched/core.c:5147 schedule+0xcf/0x270 kernel/sched/core.c:5226 wb_wait_for_completion+0x15a/0x200 fs/fs-writeback.c:209 sync_inodes_sb+0x18b/0x8a0 fs/fs-writeback.c:2577 __sync_filesystem fs/sync.c:34 [inline] sync_filesystem fs/sync.c:67 [inline] sync_filesystem+0x10b/0x1f0 fs/sync.c:48 generic_shutdown_super+0x64/0x330 fs/super.c:448 kill_block_super+0x90/0xd0 fs/super.c:1395 deactivate_locked_super+0x7b/0x130 fs/super.c:335 cleanup_mnt+0x324/0x4d0 fs/namespace.c:1136 task_work_run+0xc0/0x160 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:174 [inline] exit_to_user_mode_prepare+0x26c/0x280 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x40/0x80 kernel/entry/common.c:301 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:57 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x466ca7 RSP: 002b:00007fffdd4a56c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000466ca7 RDX: 00007fffdd4a5799 RSI: 0000000000000002 RDI: 00007fffdd4a5790 RBP: 00007fffdd4a5790 R08: 00000000ffffffff R09: 00007fffdd4a5560 R10: 00000000024dd8e3 R11: 0000000000000246 R12: 00000000004ae4c5 R13: 00007fffdd4a6840 R14: 00000000024dd810 R15: 0000000000000002 Showing all locks held in the system: 2 locks held by kworker/u4:0/7: #0: ffff8881f6236698 (&rq->lock){-.-.}-{2:2}, at: newidle_balance+0x86a/0xea0 kernel/sched/fair.c:10665 #1: ffff8881f6220888 (&per_cpu_ptr(group->pcpu, cpu)->seq){-.-.}-{0:0}, at: psi_task_switch+0x1b8/0x670 kernel/sched/psi.c:863 2 locks held by kworker/u4:2/26: #0: ffff888103d3b138 ((wq_completion)writeback){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888103d3b138 ((wq_completion)writeback){+.+.}-{0:0}, at: atomic64_set include/asm-generic/atomic-instrumented.h:856 [inline] #0: ffff888103d3b138 ((wq_completion)writeback){+.+.}-{0:0}, at: atomic_long_set include/asm-generic/atomic-long.h:41 [inline] #0: ffff888103d3b138 ((wq_completion)writeback){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:616 [inline] #0: ffff888103d3b138 ((wq_completion)writeback){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:643 [inline] #0: ffff888103d3b138 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x771/0x13d0 kernel/workqueue.c:2246 #1: ffffc900001d7db0 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x79e/0x13d0 kernel/workqueue.c:2250 2 locks held by kworker/u4:5/266: #0: ffff888103d3b138 ((wq_completion)writeback){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888103d3b138 ((wq_completion)writeback){+.+.}-{0:0}, at: atomic64_set include/asm-generic/atomic-instrumented.h:856 [inline] #0: ffff888103d3b138 ((wq_completion)writeback){+.+.}-{0:0}, at: atomic_long_set include/asm-generic/atomic-long.h:41 [inline] #0: ffff888103d3b138 ((wq_completion)writeback){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:616 [inline] #0: ffff888103d3b138 ((wq_completion)writeback){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:643 [inline] #0: ffff888103d3b138 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x771/0x13d0 kernel/workqueue.c:2246 #1: ffffc90000fe7db0 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x79e/0x13d0 kernel/workqueue.c:2250 1 lock held by khungtaskd/1160: #0: ffffffff89db4080 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x53/0x28c kernel/locking/lockdep.c:6333 1 lock held by in:imklog/5789: #0: ffff88810ec36df0 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x9c/0xb0 fs/file.c:974 2 locks held by syz-executor.2/6119: #0: ffff888109f6a0e0 (&type->s_umount_key#67){+.+.}-{3:3}, at: deactivate_super+0x5f/0x80 fs/super.c:365 #1: ffff88810c648708 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: bdi_down_write_wb_switch_rwsem fs/fs-writeback.c:344 [inline] #1: ffff88810c648708 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: sync_inodes_sb+0x171/0x8a0 fs/fs-writeback.c:2575 2 locks held by syz-executor.0/6121: #0: ffff888124cbe0e0 (&type->s_umount_key#67){+.+.}-{3:3}, at: deactivate_super+0x5f/0x80 fs/super.c:365 #1: ffff88810c57e708 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: bdi_down_write_wb_switch_rwsem fs/fs-writeback.c:344 [inline] #1: ffff88810c57e708 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: sync_inodes_sb+0x171/0x8a0 fs/fs-writeback.c:2575 ============================================= NMI backtrace for cpu 1 CPU: 1 PID: 1160 Comm: khungtaskd Not tainted 5.12.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x10c/0x14b lib/dump_stack.c:120 nmi_cpu_backtrace.cold+0x2d/0xac lib/nmi_backtrace.c:105 nmi_trigger_cpumask_backtrace+0x11f/0x170 lib/nmi_backtrace.c:62 trigger_all_cpu_backtrace include/linux/nmi.h:146 [inline] check_hung_uninterruptible_tasks kernel/hung_task.c:209 [inline] watchdog+0x9cf/0xc00 kernel/hung_task.c:294 kthread+0x36f/0x450 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Sending NMI from CPU 1 to CPUs 0: NMI backtrace for cpu 0 CPU: 0 PID: 7433 Comm: kworker/0:6 Not tainted 5.12.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events nsim_dev_trap_report_work RIP: 0010:rcu_lockdep_current_cpu_online kernel/rcu/tree.c:1218 [inline] RIP: 0010:rcu_lockdep_current_cpu_online+0x9e/0x150 kernel/rcu/tree.c:1207 Code: 48 8d 7b 18 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 90 00 00 00 48 8d 7b 20 48 8b 6b 18 48 b8 00 00 00 00 00 fc ff df 48 89 fa <48> c1 ea 03 80 3c 02 00 75 7b 48 8d 7d 70 48 8b 5b 20 48 b8 00 00 RSP: 0018:ffffc90004c57b48 EFLAGS: 00000246 RAX: dffffc0000000000 RBX: ffff8881f62374c0 RCX: ffffffff83d8d56f RDX: ffff8881f62374e0 RSI: ffffffff8878ec00 RDI: ffff8881f62374e0 RBP: ffffffff89dbeac0 R08: 0000000000000000 R09: ffffffff8b7b7d17 R10: fffffbfff16f6fa2 R11: 000000000a4f1a38 R12: 0000000000000001 R13: 1ffff9200098af72 R14: 0000000000000022 R15: ffff8881253a6024 FS: 0000000000000000(0000) GS:ffff8881f6200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fb01491e000 CR3: 000000011906b002 CR4: 00000000001706f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: rcu_read_lock_held_common kernel/rcu/update.c:112 [inline] rcu_read_lock_held_common kernel/rcu/update.c:102 [inline] rcu_read_lock_sched_held+0x25/0xb0 kernel/rcu/update.c:123 trace_get_random_bytes include/trace/events/random.h:160 [inline] _get_random_bytes+0x46b/0x550 drivers/char/random.c:1529 nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:541 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:570 [inline] nsim_dev_trap_report_work+0x710/0xb50 drivers/net/netdevsim/dev.c:611 process_one_work+0x84c/0x13d0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294