[v6.1] INFO: task hung in blkdev_flush_mapping

0 views
Skip to first unread message

syzbot

unread,
Sep 9, 2023, 6:51:01 PM9/9/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 59b13c2b647e Linux 6.1.52
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16051694680000
kernel config: https://syzkaller.appspot.com/x/.config?x=9e161b7571806ac8
dashboard link: https://syzkaller.appspot.com/bug?extid=2fe3bc8cd40705216082
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/9337ea48258d/disk-59b13c2b.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/baf3218feb51/vmlinux-59b13c2b.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e0faa5f64bea/bzImage-59b13c2b.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+2fe3bc...@syzkaller.appspotmail.com

INFO: task syz-executor.4:25835 blocked for more than 143 seconds.
Not tainted 6.1.52-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.4 state:D stack:26744 pid:25835 ppid:3580 flags:0x00004002
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5241 [inline]
__schedule+0x132c/0x4330 kernel/sched/core.c:6554
schedule+0xbf/0x180 kernel/sched/core.c:6630
io_schedule+0x88/0x100 kernel/sched/core.c:8782
folio_wait_bit_common+0x868/0x1280 mm/filemap.c:1296
__filemap_get_folio+0x44a/0xe30 mm/filemap.c:1931
truncate_inode_pages_range+0x598/0x1340 mm/truncate.c:378
kill_bdev block/bdev.c:76 [inline]
blkdev_flush_mapping+0x154/0x2b0 block/bdev.c:662
blkdev_put_whole block/bdev.c:693 [inline]
blkdev_put+0x4c0/0x750 block/bdev.c:953
blkdev_close+0x56/0x80 block/fops.c:514
__fput+0x3b7/0x890 fs/file_table.c:320
task_work_run+0x246/0x300 kernel/task_work.c:179
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0x6fb/0x2300 kernel/exit.c:869
do_group_exit+0x202/0x2b0 kernel/exit.c:1019
get_signal+0x16f7/0x17d0 kernel/signal.c:2862
arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:871
exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:297
do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fcafe27cae9
RSP: 002b:00007fcafcdfe0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: 0000000000000000 RBX: 00007fcafe39c050 RCX: 00007fcafe27cae9
RDX: 0000000000000000 RSI: 000000000000ab03 RDI: 0000000000000003
RBP: 00007fcafe2c847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007fcafe39c050 R15: 00007fffd33531c8
</TASK>

Showing all locks held in the system:
1 lock held by rcu_tasks_kthre/12:
#0: ffffffff8d12a0f0 (rcu_tasks.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x29/0xd20 kernel/rcu/tasks.h:516
1 lock held by rcu_tasks_trace/13:
#0: ffffffff8d12a8f0 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x29/0xd20 kernel/rcu/tasks.h:516
1 lock held by khungtaskd/28:
#0: ffffffff8d129f20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x0/0x30
2 locks held by getty/3300:
#0: ffff8880287a6098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:244
#1: ffffc900031262f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6a7/0x1db0 drivers/tty/n_tty.c:2188
3 locks held by kworker/u4:2/18192:
1 lock held by syz-executor.4/25835:
#0: ffff88801f7dc4c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_put+0x100/0x750 block/bdev.c:911
1 lock held by syz-executor.4/27611:
#0: ffff88801f7dc4c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x148/0xa10 block/bdev.c:813
1 lock held by syz-executor.4/27615:
#0: ffff88801f7dc4c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x148/0xa10 block/bdev.c:813
1 lock held by syz-executor.4/27682:
#0: ffff88801f7dc4c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x148/0xa10 block/bdev.c:813
1 lock held by syz-executor.4/27683:
#0: ffff88801f7dc4c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x148/0xa10 block/bdev.c:813

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

NMI backtrace for cpu 0
CPU: 0 PID: 28 Comm: khungtaskd Not tainted 6.1.52-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
nmi_cpu_backtrace+0x4e1/0x560 lib/nmi_backtrace.c:111
nmi_trigger_cpumask_backtrace+0x1b0/0x3f0 lib/nmi_backtrace.c:62
trigger_all_cpu_backtrace include/linux/nmi.h:148 [inline]
check_hung_uninterruptible_tasks kernel/hung_task.c:220 [inline]
watchdog+0xf18/0xf60 kernel/hung_task.c:377
kthread+0x26e/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
</TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 2986 Comm: syslogd Not tainted 6.1.52-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
RIP: 0010:memset_erms+0xb/0x10 arch/x86/lib/memset_64.S:65
Code: 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6 f3 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 f3 aa <4c> 89 c8 c3 90 49 89 fa 40 0f b6 ce 48 b8 01 01 01 01 01 01 01 01
RSP: 0018:ffffc9000315f5f8 EFLAGS: 00000202
RAX: 1ffff9200062be00 RBX: ffffffff8b364da1 RCX: 0000000000000000
RDX: 0000000000000050 RSI: 0000000000000000 RDI: ffffc9000315f6d0
RBP: ffffc9000315f830 R08: dffffc0000000000 R09: ffffc9000315f680
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff888076236a10
R13: ffffc9000315f680 R14: ffffc9000315f660 R15: dffffc0000000000
FS: 00007fa629d92380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2cb22000 CR3: 000000007fde6000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<NMI>
</NMI>
<TASK>
tomoyo_check_open_permission+0xf1/0x490 security/tomoyo/file.c:759
security_file_open+0x5f/0xa0 security/security.c:1649
do_dentry_open+0x308/0x10f0 fs/open.c:869
do_open fs/namei.c:3557 [inline]
path_openat+0x2644/0x2e60 fs/namei.c:3714
do_filp_open+0x230/0x480 fs/namei.c:3741
do_sys_openat2+0x13b/0x500 fs/open.c:1318
do_sys_open fs/open.c:1334 [inline]
__do_sys_openat fs/open.c:1350 [inline]
__se_sys_openat fs/open.c:1345 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1345
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fa629ee69a4
Code: 24 20 48 8d 44 24 30 48 89 44 24 28 64 8b 04 25 18 00 00 00 85 c0 75 2c 44 89 e2 48 89 ee bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 76 60 48 8b 15 55 a4 0d 00 f7 d8 64 89 02 48 83
RSP: 002b:00007ffee85ea110 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 000055c2d0f72910 RCX: 00007fa629ee69a4
RDX: 0000000000000d41 RSI: 00007fa62a085443 RDI: 00000000ffffff9c
RBP: 00007fa62a085443 R08: 0000000000000001 R09: 0000000000000000
R10: 00000000000001b6 R11: 0000000000000246 R12: 0000000000000d41
R13: 0000000064fcf6ac R14: 0000000000000004 R15: 000055c2d0f72a60
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Sep 18, 2023, 6:50:01 AM9/18/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 09045dae0d90 Linux 6.1.53
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13133ac4680000
kernel config: https://syzkaller.appspot.com/x/.config?x=195b6ef285251409
dashboard link: https://syzkaller.appspot.com/bug?extid=2fe3bc8cd40705216082
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=137c1b52680000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1508f1c2680000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c3b1bb820e74/disk-09045dae.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/4c5cfb0563d9/vmlinux-09045dae.xz
kernel image: https://storage.googleapis.com/syzbot-assets/c682edb60d96/bzImage-09045dae.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+2fe3bc...@syzkaller.appspotmail.com

INFO: task udevd:3574 blocked for more than 143 seconds.
Not tainted 6.1.53-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:udevd state:D stack:24416 pid:3574 ppid:3004 flags:0x00004006
RIP: 0033:0x7f7c4ef169a4
RSP: 002b:00007ffc356f9b40 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: 0000000000000008 RBX: 000056190c3d6cf0 RCX: 00007f7c4ef169a4
RDX: 00000000000a0800 RSI: 000056190c3c8070 RDI: 00000000ffffff9c
RBP: 000056190c3c8070 R08: 0000000000000001 R09: 0000000000000010
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000000a0800
R13: 000056190c3ca5a0 R14: 0000000000000001 R15: 000056190c3b5910
</TASK>
INFO: task syz-executor256:3592 blocked for more than 143 seconds.
Not tainted 6.1.53-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor256 state:D stack:27560 pid:3592 ppid:3570 flags:0x00004006
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5241 [inline]
__schedule+0x132c/0x4330 kernel/sched/core.c:6554
schedule+0xbf/0x180 kernel/sched/core.c:6630
schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6689
__mutex_lock_common+0xe2b/0x2520 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
blkdev_get_by_dev+0x148/0xa10 block/bdev.c:813
blkdev_open+0x12e/0x2e0 block/fops.c:500
do_dentry_open+0x7f9/0x10f0 fs/open.c:882
do_open fs/namei.c:3557 [inline]
path_openat+0x2644/0x2e60 fs/namei.c:3714
do_filp_open+0x230/0x480 fs/namei.c:3741
do_sys_openat2+0x13b/0x500 fs/open.c:1318
do_sys_open fs/open.c:1334 [inline]
__do_sys_openat fs/open.c:1350 [inline]
__se_sys_openat fs/open.c:1345 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1345
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fc08e12d570
RSP: 002b:00007fc08e0ebd90 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fc08e12d570
RDX: 0000000000000000 RSI: 00007fc08e0ebe10 RDI: 00000000ffffff9c
RBP: 00007fc08e0ebe10 R08: 0000000000000000 R09: 002364626e2f7665
R10: 0000000000000000 R11: 0000000000000293 R12: 6666666666666667
R13: 00007fc08e1821a4 R14: 64626e2f7665642f R15: 00007fff7155f268
</TASK>

Showing all locks held in the system:
1 lock held by rcu_tasks_kthre/12:
#0: ffffffff8d12a1b0 (rcu_tasks.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x29/0xd20 kernel/rcu/tasks.h:516
1 lock held by rcu_tasks_trace/13:
#0: ffffffff8d12a9b0 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x29/0xd20 kernel/rcu/tasks.h:516
1 lock held by khungtaskd/28:
#0: ffffffff8d129fe0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x0/0x30
2 locks held by getty/3307:
#0: ffff888028cb7098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:244
#1: ffffc900031262f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6a7/0x1db0 drivers/tty/n_tty.c:2188
1 lock held by udevd/3574:
#0: ffff88801f6ef4c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_put+0x100/0x750 block/bdev.c:911
1 lock held by syz-executor256/3592:
#0: ffff88801f6ef4c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x148/0xa10 block/bdev.c:813

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

NMI backtrace for cpu 1
CPU: 1 PID: 28 Comm: khungtaskd Not tainted 6.1.53-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
nmi_cpu_backtrace+0x4e1/0x560 lib/nmi_backtrace.c:111
nmi_trigger_cpumask_backtrace+0x1b0/0x3f0 lib/nmi_backtrace.c:62
trigger_all_cpu_backtrace include/linux/nmi.h:148 [inline]
check_hung_uninterruptible_tasks kernel/hung_task.c:220 [inline]
watchdog+0xf18/0xf60 kernel/hung_task.c:377
kthread+0x26e/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
</TASK>
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 PID: 56 Comm: kworker/u4:4 Not tainted 6.1.53-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
Workqueue: events_unbound toggle_allocation_gate
RIP: 0010:inat_immediate_size arch/x86/include/asm/inat.h:188 [inline]
RIP: 0010:insn_get_immediate+0xf1/0x1390 arch/x86/lib/insn.c:647
Code: f7 89 e8 25 00 00 02 00 0f 85 50 01 00 00 89 ee 81 e6 00 38 00 00 31 ff e8 9c 53 06 f7 89 e8 25 00 38 00 00 0f 84 80 03 00 00 <c1> ed 0b 83 e5 07 48 89 ef 48 c7 c6 50 73 5d 8e e8 7a 54 06 f7 ff
RSP: 0018:ffffc90001577880 EFLAGS: 00000206
RAX: 0000000000003000 RBX: 1ffff920002aef39 RCX: ffff8880162c9dc0
RDX: ffff8880162c9dc0 RSI: 0000000000003000 RDI: 0000000000000000
RBP: 000000000000b000 R08: ffffffff8a83c3f4 R09: ffffc90001577980
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90001577980
R13: ffffc900015779bc R14: 1ffff920002aef37 R15: ffffc900015779cc
FS: 0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055cd9c84f680 CR3: 000000000ce8e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<NMI>
</NMI>
<TASK>
insn_get_length arch/x86/lib/insn.c:707 [inline]
insn_decode+0x36c/0x500 arch/x86/lib/insn.c:747
arch_jump_entry_size arch/x86/kernel/jump_label.c:24 [inline]
__jump_label_patch+0xe4/0x440 arch/x86/kernel/jump_label.c:45
arch_jump_label_transform_queue+0x4a/0xd0 arch/x86/kernel/jump_label.c:137
__jump_label_update+0x177/0x3a0 kernel/jump_label.c:447
static_key_disable_cpuslocked+0xca/0x1b0 kernel/jump_label.c:207
static_key_disable+0x16/0x20 kernel/jump_label.c:215
toggle_allocation_gate+0x3e0/0x480 mm/kfence/core.c:818
process_one_work+0x8aa/0x11f0 kernel/workqueue.c:2292
worker_thread+0xa5f/0x1210 kernel/workqueue.c:2439
kthread+0x26e/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
</TASK>
INFO: NMI handler (nmi_cpu_backtrace_handler) took too long to run: 1.322 msecs


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
Reply all
Reply to author
Forward
0 new messages