[v6.1] INFO: task hung in __filemap_get_folio

12 views
Skip to first unread message

syzbot

unread,
Apr 2, 2023, 9:36:45 PM4/2/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3b29299e5f60 Linux 6.1.22
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14615f85c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=4a782518325cb082
dashboard link: https://syzkaller.appspot.com/bug?extid=bd081b10a5bc611b2987
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/f6cdeb0f8946/disk-3b29299e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/cc5e0da6e9ab/vmlinux-3b29299e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9e31f151a6a5/bzImage-3b29299e.xz

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

INFO: task syz-executor.3:5897 blocked for more than 145 seconds.
Not tainted 6.1.22-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.3 state:D stack:24904 pid:5897 ppid:3671 flags:0x00004004
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:8774
folio_wait_bit_common+0x868/0x1280 mm/filemap.c:1296
__filemap_get_folio+0x44a/0xe30 mm/filemap.c:1931
pagecache_get_page+0x28/0x250 mm/folio-compat.c:110
find_or_create_page include/linux/pagemap.h:613 [inline]
ni_readpage_cmpr+0x31b/0xa70 fs/ntfs3/frecord.c:2130
ntfs_read_folio+0x19a/0x210 fs/ntfs3/inode.c:713
filemap_read_folio+0x199/0x780 mm/filemap.c:2407
filemap_create_folio mm/filemap.c:2536 [inline]
filemap_get_pages mm/filemap.c:2589 [inline]
filemap_read+0x122a/0x31d0 mm/filemap.c:2676
call_read_iter include/linux/fs.h:2199 [inline]
generic_file_splice_read+0x23c/0x630 fs/splice.c:309
do_splice_to fs/splice.c:793 [inline]
splice_direct_to_actor+0x408/0xbd0 fs/splice.c:865
do_splice_direct+0x27f/0x3c0 fs/splice.c:974
do_sendfile+0x61c/0xff0 fs/read_write.c:1255
__do_sys_sendfile64 fs/read_write.c:1323 [inline]
__se_sys_sendfile64+0x178/0x1e0 fs/read_write.c:1309
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:0x7f48efa8c0f9
RSP: 002b:00007f48f0712168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f48efbabf80 RCX: 00007f48efa8c0f9
RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000004
RBP: 00007f48efae7b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0001000000201005 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffe70e0846f R14: 00007f48f0712300 R15: 0000000000022000
</TASK>
INFO: task syz-executor.3:5927 blocked for more than 146 seconds.
Not tainted 6.1.22-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.3 state:D stack:24584 pid:5927 ppid:3671 flags:0x00004004
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:8774
folio_wait_bit_common+0x868/0x1280 mm/filemap.c:1296
__filemap_get_folio+0x44a/0xe30 mm/filemap.c:1931
pagecache_get_page+0x28/0x250 mm/folio-compat.c:110
find_or_create_page include/linux/pagemap.h:613 [inline]
ntfs_get_frame_pages fs/ntfs3/file.c:873 [inline]
ntfs_compress_write+0x695/0x1c00 fs/ntfs3/file.c:961
ntfs_file_write_iter+0x3d7/0x6d0 fs/ntfs3/file.c:1163
do_iter_write+0x6e6/0xc50 fs/read_write.c:861
iter_file_splice_write+0x806/0xfa0 fs/splice.c:686
do_splice_from fs/splice.c:764 [inline]
direct_splice_actor+0xe3/0x1c0 fs/splice.c:931
splice_direct_to_actor+0x4c0/0xbd0 fs/splice.c:886
do_splice_direct+0x27f/0x3c0 fs/splice.c:974
do_sendfile+0x61c/0xff0 fs/read_write.c:1255
__do_sys_sendfile64 fs/read_write.c:1323 [inline]
__se_sys_sendfile64+0x178/0x1e0 fs/read_write.c:1309
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:0x7f48efa8c0f9
RSP: 002b:00007f48e63fe168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f48efbac050 RCX: 00007f48efa8c0f9
RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000004
RBP: 00007f48efae7b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0001000000201005 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffe70e0846f R14: 00007f48e63fe300 R15: 0000000000022000
</TASK>

Showing all locks held in the system:
1 lock held by rcu_tasks_kthre/12:
#0: ffffffff8cf26830 (rcu_tasks.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x29/0xd20 kernel/rcu/tasks.h:510
1 lock held by rcu_tasks_trace/13:
#0: ffffffff8cf27030 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x29/0xd20 kernel/rcu/tasks.h:510
1 lock held by khungtaskd/28:
#0: ffffffff8cf26660 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x0/0x30
2 locks held by getty/3313:
#0: ffff88814af12098 (&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:2177
1 lock held by syz-executor.1/3666:
3 locks held by kworker/1:6/31435:
#0: ffff888012464d38 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x77a/0x11f0
#1: ffffc900151d7d20 (fqdir_free_work){+.+.}-{0:0}, at: process_one_work+0x7bd/0x11f0 kernel/workqueue.c:2264
#2: ffffffff8cf2bb00 (rcu_state.barrier_mutex){+.+.}-{3:3}, at: rcu_barrier+0x48/0x5f0 kernel/rcu/tree.c:3953
3 locks held by kworker/u4:25/4512:
#0: ffff888012606938 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work+0x77a/0x11f0
#1: ffffc90010c47d20 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work+0x7bd/0x11f0 kernel/workqueue.c:2264
#2: ffffffff8cf2bb00 (rcu_state.barrier_mutex){+.+.}-{3:3}, at: rcu_barrier+0x48/0x5f0 kernel/rcu/tree.c:3953
3 locks held by syz-executor.3/5897:
#0: ffff888047d3e460 (sb_writers#14){.+.+}-{0:0}, at: do_sendfile+0x5f7/0xff0 fs/read_write.c:1254
#1: ffff88809a9622c0 (mapping.invalidate_lock#5){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:811 [inline]
#1: ffff88809a9622c0 (mapping.invalidate_lock#5){.+.+}-{3:3}, at: filemap_create_folio mm/filemap.c:2528 [inline]
#1: ffff88809a9622c0 (mapping.invalidate_lock#5){.+.+}-{3:3}, at: filemap_get_pages mm/filemap.c:2589 [inline]
#1: ffff88809a9622c0 (mapping.invalidate_lock#5){.+.+}-{3:3}, at: filemap_read+0xe9f/0x31d0 mm/filemap.c:2676
#2: ffff88809a961e80 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1108 [inline]
#2: ffff88809a961e80 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_read_folio+0x18f/0x210 fs/ntfs3/inode.c:712
2 locks held by syz-executor.3/5927:
#0: ffff888047d3e460 (sb_writers#14){.+.+}-{0:0}, at: do_sendfile+0x5f7/0xff0 fs/read_write.c:1254
#1: ffff88809a962120 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}, at: inode_trylock include/linux/fs.h:776 [inline]
#1: ffff88809a962120 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}, at: ntfs_file_write_iter+0x1c7/0x6d0 fs/ntfs3/file.c:1143
3 locks held by syz-executor.0/7920:
1 lock held by syz-executor.0/7921:

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

NMI backtrace for cpu 0
CPU: 0 PID: 28 Comm: khungtaskd Not tainted 6.1.22-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/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+0x268/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: 22757 Comm: kworker/u4:7 Not tainted 6.1.22-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Workqueue: bat_events batadv_nc_worker
RIP: 0010:kasan_check_range+0x3/0x290 mm/kasan/generic.c:188
Code: 48 89 c7 e8 1f df 9e 08 31 c0 c3 0f 0b b8 ea ff ff ff c3 0f 0b b8 ea ff ff ff c3 cc cc cc cc cc cc cc cc cc cc cc cc 55 41 57 <41> 56 53 b0 01 48 85 f6 0f 84 9a 01 00 00 48 89 fd 48 01 f5 0f 82
RSP: 0018:ffffc9000633f628 EFLAGS: 00000046
RAX: 000000000000001b RBX: 00000000000006c9 RCX: ffffffff816a5b55
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffffff9026f258
RBP: ffffc9000633f8f0 R08: dffffc0000000000 R09: fffffbfff204de4c
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff888079ba4540 R14: 2e10de906a811b74 R15: 1ffff1100f3748a8
FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005555560d1888 CR3: 000000000cc8e000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
instrument_atomic_read include/linux/instrumented.h:72 [inline]
_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
hlock_class kernel/locking/lockdep.c:228 [inline]
lookup_chain_cache_add kernel/locking/lockdep.c:3744 [inline]
validate_chain+0x115/0x58e0 kernel/locking/lockdep.c:3800
__lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5669
__raw_spin_lock_bh include/linux/spinlock_api_smp.h:126 [inline]
_raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:178
spin_lock_bh include/linux/spinlock.h:355 [inline]
batadv_nc_purge_paths+0xe8/0x3b0 net/batman-adv/network-coding.c:442
batadv_nc_worker+0x30b/0x5b0 net/batman-adv/network-coding.c:722
process_one_work+0x8aa/0x11f0 kernel/workqueue.c:2289
worker_thread+0xa5f/0x1210 kernel/workqueue.c:2436
kthread+0x268/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
</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.

syzbot

unread,
May 21, 2023, 6:05:48 PM5/21/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: fa74641fb6b9 Linux 6.1.29
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17bfaff9280000
kernel config: https://syzkaller.appspot.com/x/.config?x=7454aa89ac475d7b
dashboard link: https://syzkaller.appspot.com/bug?extid=bd081b10a5bc611b2987
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17862555280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14ab8f7e280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/53e4da6b145c/disk-fa74641f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/adeb1a2cfa86/vmlinux-fa74641f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/c976f1155d08/Image-fa74641f.gz.xz

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

INFO: task udevd:4263 blocked for more than 143 seconds.
Not tainted 6.1.29-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:udevd state:D stack:0 pid:4263 ppid:3838 flags:0x0000000d
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:553
context_switch kernel/sched/core.c:5241 [inline]
__schedule+0xee4/0x1c98 kernel/sched/core.c:6554
schedule+0xc4/0x170 kernel/sched/core.c:6630
io_schedule+0x8c/0x188 kernel/sched/core.c:8774
folio_wait_bit_common+0x65c/0xb90 mm/filemap.c:1296
__folio_lock mm/filemap.c:1659 [inline]
folio_lock include/linux/pagemap.h:939 [inline]
__filemap_get_folio+0x5ac/0xb6c mm/filemap.c:1931
truncate_inode_pages_range+0x47c/0xf10 mm/truncate.c:378
truncate_inode_pages+0x2c/0x3c mm/truncate.c:452
kill_bdev block/bdev.c:76 [inline]
blkdev_flush_mapping+0x134/0x280 block/bdev.c:662
blkdev_put_whole block/bdev.c:693 [inline]
blkdev_put+0x464/0x6e0 block/bdev.c:953
blkdev_close+0x58/0x94 block/fops.c:514
__fput+0x30c/0x7bc fs/file_table.c:320
____fput+0x20/0x30 fs/file_table.c:348
task_work_run+0x240/0x2f0 kernel/task_work.c:179
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0x554/0x1a88 kernel/exit.c:869
do_group_exit+0x194/0x22c kernel/exit.c:1019
get_signal+0x14a0/0x158c kernel/signal.c:2858
do_signal arch/arm64/kernel/signal.c:1076 [inline]
do_notify_resume+0x3ac/0x3470 arch/arm64/kernel/signal.c:1129
prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
el0_svc+0x9c/0x168 arch/arm64/kernel/entry-common.c:638
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581
INFO: task syz-executor390:4696 blocked for more than 143 seconds.
Not tainted 6.1.29-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor390 state:D stack:0 pid:4696 ppid:4259 flags:0x00000001
Call trace:
__switch_to+0x320/0x754 arch/arm64/kernel/process.c:553
context_switch kernel/sched/core.c:5241 [inline]
__schedule+0xee4/0x1c98 kernel/sched/core.c:6554
schedule+0xc4/0x170 kernel/sched/core.c:6630
schedule_preempt_disabled+0x18/0x2c kernel/sched/core.c:6689
__mutex_lock_common+0xbd8/0x21a0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
blkdev_get_by_dev+0x12c/0x8ec block/bdev.c:813
blkdev_open+0x10c/0x290 block/fops.c:500
do_dentry_open+0x734/0xfa0 fs/open.c:882
vfs_open+0x7c/0x90 fs/open.c:1013
do_open fs/namei.c:3557 [inline]
path_openat+0x1e14/0x2548 fs/namei.c:3714
do_filp_open+0x1bc/0x3cc fs/namei.c:3741
do_sys_openat2+0x128/0x3d8 fs/open.c:1310
do_sys_open fs/open.c:1326 [inline]
__do_sys_openat fs/open.c:1342 [inline]
__se_sys_openat fs/open.c:1337 [inline]
__arm64_sys_openat+0x1f0/0x240 fs/open.c:1337
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

Showing all locks held in the system:
1 lock held by rcu_tasks_kthre/12:
#0: ffff800015774ef0 (rcu_tasks.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x44/0xcf4 kernel/rcu/tasks.h:510
1 lock held by rcu_tasks_trace/13:
#0: ffff8000157756f0 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x44/0xcf4 kernel/rcu/tasks.h:510
1 lock held by khungtaskd/28:
#0: ffff800015774d20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0xc/0x44 include/linux/rcupdate.h:305
2 locks held by getty/3981:
#0: ffff0000d632f098 (&tty->ldisc_sem){++++}-{0:0}, at: ldsem_down_read+0x3c/0x4c drivers/tty/tty_ldsem.c:340
#1: ffff80001ca202f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x414/0x1210 drivers/tty/n_tty.c:2177
1 lock held by udevd/4263:
#0: ffff0000ce56c4c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_put+0xec/0x6e0 block/bdev.c:911
1 lock held by syz-executor390/4696:
#0: ffff0000ce56c4c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0x12c/0x8ec block/bdev.c:813

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



---
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