syzbot


INFO: task hung in blkdev_flush_mapping

Status: upstream: reported on 2024/03/26 14:18
Reported-by: syzbot+fd75559d2bc0789dcd0f@syzkaller.appspotmail.com
First crash: 42d, last: 42d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 INFO: task hung in blkdev_flush_mapping origin:upstream C 2 30d 240d 0/3 upstream: reported C repro on 2023/09/09 22:51
upstream INFO: task hung in blkdev_flush_mapping block C unreliable 9 16d 141d 0/26 upstream: reported C repro on 2023/12/18 10:31

Sample crash report:
INFO: task udevd:5040 blocked for more than 143 seconds.
      Not tainted 5.15.152-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:udevd           state:D stack:25952 pid: 5040 ppid:  2964 flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5030 [inline]
 __schedule+0x12c4/0x45b0 kernel/sched/core.c:6376
 schedule+0x11b/0x1f0 kernel/sched/core.c:6459
 io_schedule+0x88/0x100 kernel/sched/core.c:8484
 wait_on_page_bit_common+0xa13/0x1180 mm/filemap.c:1356
 lock_page include/linux/pagemap.h:625 [inline]
 truncate_inode_pages_range+0xc17/0x1290 mm/truncate.c:394
 kill_bdev block/bdev.c:77 [inline]
 blkdev_flush_mapping+0x182/0x340 block/bdev.c:659
 blkdev_put_part block/bdev.c:728 [inline]
 blkdev_put+0x46c/0x790 block/bdev.c:952
 blkdev_close+0x7c/0xa0 block/fops.c:475
 __fput+0x3bf/0x890 fs/file_table.c:280
 task_work_run+0x129/0x1a0 kernel/task_work.c:164
 exit_task_work include/linux/task_work.h:32 [inline]
 do_exit+0x6a3/0x2480 kernel/exit.c:872
 do_group_exit+0x144/0x310 kernel/exit.c:994
 get_signal+0xc66/0x14e0 kernel/signal.c:2889
 arch_do_signal_or_restart+0xc3/0x1890 arch/x86/kernel/signal.c:867
 handle_signal_work kernel/entry/common.c:148 [inline]
 exit_to_user_mode_loop+0x97/0x130 kernel/entry/common.c:172
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:208
 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
 syscall_exit_to_user_mode+0x5d/0x250 kernel/entry/common.c:301
 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f9b7b3dbb6a
RSP: 002b:00007ffc582e9cb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
RAX: fffffffffffffffc RBX: 0000000000001000 RCX: 00007f9b7b3dbb6a
RDX: 0000000000000400 RSI: 0000558e5913d5a8 RDI: 0000000000000009
RBP: 0000000000000400 R08: 0000558e5913d580 R09: 0000000000000008
R10: 0000000000000051 R11: 0000000000000246 R12: 0000558e5913d580
R13: 0000558e5913d598 R14: 0000558e59110148 R15: 0000558e591100f0
 </TASK>

Showing all locks held in the system:
1 lock held by khungtaskd/27:
 #0: ffffffff8c91f720 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x0/0x30
2 locks held by getty/3266:
 #0: ffff88814b283098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:252
 #1: ffffc90002bad2e8 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6af/0x1db0 drivers/tty/n_tty.c:2158
3 locks held by kworker/u5:1/3519:
 #0: ffff8880238a5938 ((wq_completion)hci8){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2283
 #1: ffffc90002dc7d20 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x7d0/0x10c0 kernel/workqueue.c:2285
 #2: ffff88805618cff0 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_open+0xa4/0x1330 net/bluetooth/hci_core.c:1446
1 lock held by udevd/5040:
 #0: ffff88801c1e3918 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_put+0xfb/0x790 block/bdev.c:912
1 lock held by syz-executor.1/8314:
 #0: ffff88801c1e3918 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x14d/0xa50 block/bdev.c:817
1 lock held by syz-executor.1/8717:
 #0: ffff88801c1e3918 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x14d/0xa50 block/bdev.c:817
1 lock held by syz-executor.1/9196:
 #0: ffff88801c1e3918 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x14d/0xa50 block/bdev.c:817
1 lock held by syz-executor.1/9604:
 #0: ffff888076ef6098 (&tty->ldisc_sem){++++}-{0:0}, at: __tty_ldisc_lock drivers/tty/tty_ldisc.c:300 [inline]
 #0: ffff888076ef6098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_lock_pair_timeout drivers/tty/tty_ldisc.c:363 [inline]
 #0: ffff888076ef6098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_lock_pair drivers/tty/tty_ldisc.c:377 [inline]
 #0: ffff888076ef6098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_release+0x10c/0x200 drivers/tty/tty_ldisc.c:802

=============================================

NMI backtrace for cpu 0
CPU: 0 PID: 27 Comm: khungtaskd Not tainted 5.15.152-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 nmi_cpu_backtrace+0x46a/0x4a0 lib/nmi_backtrace.c:111
 nmi_trigger_cpumask_backtrace+0x181/0x2a0 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:148 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:210 [inline]
 watchdog+0xe72/0xeb0 kernel/hung_task.c:295
 kthread+0x3f6/0x4f0 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 373 Comm: kworker/u4:3 Not tainted 5.15.152-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
Workqueue: bat_events batadv_iv_send_outstanding_bat_ogm_packet
RIP: 0010:lock_acquire+0x92/0x4f0 kernel/locking/lockdep.c:5591
Code: 81 4c 8d 64 24 40 49 c1 ec 03 48 b8 f1 f1 f1 f1 00 f2 f2 f2 4b 89 04 2c 43 c7 44 2c 09 f2 f2 f2 00 43 c7 44 2c 11 f3 f3 f3 f3 <66> 43 c7 44 2c 15 f3 f3 43 c6 44 2c 17 f3 0f 1f 44 00 00 65 8b 1d
RSP: 0018:ffffc900024e78e0 EFLAGS: 00000a06
RAX: f2f2f200f1f1f1f1 RBX: 0000000000000231 RCX: 0000000000000002
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff8c91f720
RBP: ffffc900024e7a40 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff9200049cf24
R13: dffffc0000000000 R14: 0000000000000000 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055555563b938 CR3: 00000000232fc000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <NMI>
 </NMI>
 <TASK>
 rcu_lock_acquire+0x2a/0x30 include/linux/rcupdate.h:269
 rcu_read_lock include/linux/rcupdate.h:696 [inline]
 batadv_iv_ogm_slide_own_bcast_window net/batman-adv/bat_iv_ogm.c:755 [inline]
 batadv_iv_ogm_schedule_buff net/batman-adv/bat_iv_ogm.c:826 [inline]
 batadv_iv_ogm_schedule+0x429/0x1000 net/batman-adv/bat_iv_ogm.c:869
 batadv_iv_send_outstanding_bat_ogm_packet+0x6fa/0x800 net/batman-adv/bat_iv_ogm.c:1713
 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
 kthread+0x3f6/0x4f0 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/03/26 14:17 linux-5.15.y b95c01af2113 bcd9b39f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan INFO: task hung in blkdev_flush_mapping
* Struck through repros no longer work on HEAD.