[net?] KASAN: out-of-bounds Write in stack_trace_consume_entry

5 views
Skip to first unread message

syzbot

unread,
Apr 19, 2023, 4:20:47 PM4/19/23
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 7a934f4bd7d6 Merge tag 'riscv-for-linus-6.3-rc7' of git://..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13b4f760280000
kernel config: https://syzkaller.appspot.com/x/.config?x=90aa79dcf599c3f1
dashboard link: https://syzkaller.appspot.com/bug?extid=41eb4c478f352f548951
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
CC: [b...@vger.kernel.org da...@davemloft.net edum...@google.com ku...@kernel.org linux-...@vger.kernel.org net...@vger.kernel.org pab...@redhat.com]

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

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

==================================================================
BUG: KASAN: out-of-bounds in stack_trace_consume_entry+0x141/0x160 kernel/stacktrace.c:93
Write of size 8 at addr ffffc90002f7f910 by task kworker/0:1/15335

CPU: 0 PID: 15335 Comm: kworker/0:1 Not tainted 6.3.0-rc6-syzkaller-00173-g7a934f4bd7d6 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
Workqueue: events nsim_dev_trap_report_work
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_delayed_work+0x1c8/0x270 kernel/workqueue.c:1672
queue_delayed_work_on+0x109/0x120 kernel/workqueue.c:1708
queue_delayed_work include/linux/workqueue.h:519 [inline]
schedule_delayed_work include/linux/workqueue.h:671 [inline]
nsim_dev_trap_report_work+0x9d1/0xc80 drivers/net/netdevsim/dev.c:845
process_one_work+0x991/0x15c0 kernel/workqueue.c:2390
worker_thread+0x669/0x1090 kernel/workqueue.c:2537
kthread+0x2e8/0x3a0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</TASK>

The buggy address belongs to stack of task kworker/0:1/15335
and is located at offset 176 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
[ffffc90002f78000, ffffc90002f81000) created by:
kernel_clone+0xeb/0x890 kernel/fork.c:2682

The buggy address belongs to the physical page:
page:ffffea0001bd22c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6f48b
flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff)
raw: 04fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_ZERO), pid 4593, tgid 4593 (udevd), ts 268694820916, free_ts 0
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:2283
vm_area_alloc_pages mm/vmalloc.c:2953 [inline]
__vmalloc_area_node mm/vmalloc.c:3029 [inline]
__vmalloc_node_range+0xb1c/0x14a0 mm/vmalloc.c:3201
alloc_thread_stack_node kernel/fork.c:311 [inline]
dup_task_struct kernel/fork.c:982 [inline]
copy_process+0x1320/0x7590 kernel/fork.c:2098
kernel_clone+0xeb/0x890 kernel/fork.c:2682
__do_sys_clone+0xba/0x100 kernel/fork.c:2823
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_owner free stack trace missing

Memory state around the buggy address:
ffffc90002f7f800: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
ffffc90002f7f880: 00 00 00 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00
>ffffc90002f7f900: 00 00 04 00 72 00 00 00 00 00 00 00 00 00 00 00
^
ffffc90002f7f980: 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffc90002f7fa00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


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

Aleksandr Nogikh

unread,
Apr 20, 2023, 5:38:38 AM4/20/23
to syzbot, syzkaller-upst...@googlegroups.com
#syz invalid

Stack parsing was fixed in
https://github.com/google/syzkaller/commit/436577a9370c12a7aae3e7f30dcaec02e1c8b42e
Let's wait until it reappears with the correct title.
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-upstream-moderation" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-upstream-m...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-upstream-moderation/000000000000b67bf805f9b628a8%40google.com.
Reply all
Reply to author
Forward
0 new messages