syzbot


KASAN: out-of-bounds Write in loop_queue_rq

Status: auto-obsoleted due to no activity on 2023/07/19 21:56
Subsystems: block
[Documentation on labels]
Reported-by: syzbot+3e9507a9cfc6b5e2e527@syzkaller.appspotmail.com
First crash: 372d, last: 372d

Sample crash report:
==================================================================
BUG: KASAN: out-of-bounds in stack_trace_consume_entry+0x141/0x160 kernel/stacktrace.c:93
Write of size 8 at addr ffffc9000424ef20 by task syz-executor.1/26039

CPU: 3 PID: 26039 Comm: syz-executor.1 Not tainted 6.3.0-rc7-syzkaller-00089-gcb0856346a60 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:319
 print_report mm/kasan/report.c:430 [inline]
 kasan_report+0x11c/0x130 mm/kasan/report.c:536
 stack_trace_consume_entry+0x141/0x160 kernel/stacktrace.c:93
 arch_stack_walk+0x71/0xf0 arch/x86/kernel/stacktrace.c:27
 stack_trace_save+0x90/0xc0 kernel/stacktrace.c:122
 kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
 __kasan_record_aux_stack+0x7b/0x90 mm/kasan/generic.c:491
 insert_work+0x48/0x350 kernel/workqueue.c:1361
 __queue_work+0x625/0x1120 kernel/workqueue.c:1524
 queue_work_on+0xf2/0x110 kernel/workqueue.c:1552
 queue_work include/linux/workqueue.h:504 [inline]
 loop_queue_work drivers/block/loop.c:897 [inline]
 loop_queue_rq+0x61d/0x1260 drivers/block/loop.c:1855
 __blk_mq_issue_directly block/blk-mq.c:2585 [inline]
 __blk_mq_try_issue_directly+0x53c/0x740 block/blk-mq.c:2638
 blk_mq_try_issue_directly+0x21/0xf0 block/blk-mq.c:2662
 blk_mq_submit_bio+0x150c/0x1d40 block/blk-mq.c:2989
 __submit_bio+0x2b7/0x340 block/blk-core.c:602
 __submit_bio_noacct_mq block/blk-core.c:679 [inline]
 submit_bio_noacct_nocheck+0x960/0xb90 block/blk-core.c:708
 submit_bio_noacct+0x952/0x1a30 block/blk-core.c:807
 submit_bio block/blk-core.c:843 [inline]
 submit_bio+0x8f/0x1c0 block/blk-core.c:831
 submit_bh fs/buffer.c:2755 [inline]
 __bh_read_batch+0xfe/0x270 fs/buffer.c:3064
 bh_readahead_batch include/linux/buffer_head.h:449 [inline]
 reiserfs_breada+0x1ea/0x470 fs/reiserfs/journal.c:2347
 journal_read fs/reiserfs/journal.c:2449 [inline]
 journal_init+0x23e3/0x64c0 fs/reiserfs/journal.c:2897
 reiserfs_fill_super+0xc5b/0x2ea0 fs/reiserfs/super.c:2022
 mount_bdev+0x351/0x410 fs/super.c:1380
 legacy_get_tree+0x109/0x220 fs/fs_context.c:610
 vfs_get_tree+0x8d/0x350 fs/super.c:1510
 do_new_mount fs/namespace.c:3042 [inline]
 path_mount+0x1342/0x1e40 fs/namespace.c:3372
 do_mount fs/namespace.c:3385 [inline]
 __do_sys_mount fs/namespace.c:3594 [inline]
 __se_sys_mount fs/namespace.c:3571 [inline]
 __x64_sys_mount+0x283/0x300 fs/namespace.c:3571
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fd3ce68d69a
Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fd3cf453f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000001101 RCX: 00007fd3ce68d69a
RDX: 0000000020001100 RSI: 00000000200001c0 RDI: 00007fd3cf453fe0
RBP: 00007fd3cf454020 R08: 00007fd3cf454020 R09: 0000000000208088
R10: 0000000000208088 R11: 0000000000000202 R12: 0000000020001100
R13: 00000000200001c0 R14: 00007fd3cf453fe0 R15: 0000000020000240
 </TASK>

The buggy address belongs to stack of task syz-executor.1/26039
 and is located at offset 184 in frame:
 stack_trace_save+0x0/0xc0 kernel/stacktrace.c:395

This frame has 1 object:
 [32, 56) 'c'

The buggy address belongs to the virtual mapping at
 [ffffc90004248000, ffffc90004251000) created by:
 kernel_clone+0xeb/0x890 kernel/fork.c:2683

The buggy address belongs to the physical page:
page:ffffea0001334240 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4cd09
memcg:ffff88801fd00982
flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff)
raw: 04fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff ffff88801fd00982
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 25989, tgid 25989 (syz-executor.0), ts 906640714574, free_ts 906595630555
 prep_new_page mm/page_alloc.c:2553 [inline]
 get_page_from_freelist+0x1190/0x2e20 mm/page_alloc.c:4326
 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:5592
 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2277
 vm_area_alloc_pages mm/vmalloc.c:2957 [inline]
 __vmalloc_area_node mm/vmalloc.c:3033 [inline]
 __vmalloc_node_range+0xb1c/0x14a0 mm/vmalloc.c:3205
 alloc_thread_stack_node kernel/fork.c:311 [inline]
 dup_task_struct kernel/fork.c:982 [inline]
 copy_process+0x1320/0x7590 kernel/fork.c:2099
 kernel_clone+0xeb/0x890 kernel/fork.c:2683
 __do_sys_clone+0xba/0x100 kernel/fork.c:2824
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1454 [inline]
 free_pcp_prepare+0x5d5/0xa50 mm/page_alloc.c:1504
 free_unref_page_prepare mm/page_alloc.c:3388 [inline]
 free_unref_page+0x1d/0x490 mm/page_alloc.c:3483
 vfree+0x180/0x7e0 mm/vmalloc.c:2746
 free_journal_ram+0x118/0x600 fs/reiserfs/journal.c:1886
 do_journal_release fs/reiserfs/journal.c:1960 [inline]
 journal_release+0x276/0x630 fs/reiserfs/journal.c:1971
 reiserfs_put_super+0xe4/0x5c0 fs/reiserfs/super.c:616
 generic_shutdown_super+0x158/0x480 fs/super.c:500
 kill_block_super+0x9b/0xf0 fs/super.c:1407
 deactivate_locked_super+0x98/0x160 fs/super.c:331
 deactivate_super+0xb1/0xd0 fs/super.c:362
 cleanup_mnt+0x2ae/0x3d0 fs/namespace.c:1177
 task_work_run+0x16f/0x270 kernel/task_work.c:179
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
 exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204
 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
 syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297
 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Memory state around the buggy address:
 ffffc9000424ee00: 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1
 ffffc9000424ee80: f1 00 00 00 f3 f3 f3 f3 f3 00 00 00 00 00 00 00
>ffffc9000424ef00: 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
                               ^
 ffffc9000424ef80: 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffc9000424f000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/04/20 21:55 upstream cb0856346a60 5ed6c74d .config console log report info ci-qemu-upstream KASAN: out-of-bounds Write in loop_queue_rq
* Struck through repros no longer work on HEAD.