syzbot


KASAN: out-of-bounds Read in proc_pid_stack (2)

Status: moderation: reported on 2025/07/04 00:02
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+3fbbb996519a1dc3aeb3@syzkaller.appspotmail.com
First crash: 109d, last: 21d
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: out-of-bounds Read in proc_pid_stack fuse 17 syz 3 284d 284d 0/29 closed as dup on 2025/01/06 10:20
upstream KASAN: stack-out-of-bounds Read in proc_pid_stack (2) fs 17 1 460d 419d 0/29 auto-obsoleted due to no activity on 2024/10/21 18:27
upstream KASAN: stack-out-of-bounds Read in proc_pid_stack riscv 17 3 864d 899d 22/29 fixed on 2023/06/08 14:41

Sample crash report:
==================================================================
BUG: KASAN: out-of-bounds in walk_stackframe+0x3e0/0x44e arch/riscv/kernel/stacktrace.c:67
Read of size 8 at addr ffff8f8002e475a8 by task syz.6.1129/12559

CPU: 0 UID: 0 PID: 12559 Comm: syz.6.1129 Not tainted syzkaller #0 PREEMPT 
Hardware name: riscv-virtio,qemu (DT)
Call Trace:
[<ffffffff8007a45c>] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:132
[<ffffffff8000329a>] show_stack+0x30/0x3c arch/riscv/kernel/stacktrace.c:138
[<ffffffff8006163e>] __dump_stack lib/dump_stack.c:94 [inline]
[<ffffffff8006163e>] dump_stack_lvl+0x12e/0x1a6 lib/dump_stack.c:120
[<ffffffff8000ee40>] print_address_description mm/kasan/report.c:378 [inline]
[<ffffffff8000ee40>] print_report+0x28e/0x5a2 mm/kasan/report.c:482
[<ffffffff80b1f85a>] kasan_report+0xf0/0x214 mm/kasan/report.c:595
[<ffffffff80b218f2>] __asan_report_load8_noabort+0x12/0x1a mm/kasan/report_generic.c:381
[<ffffffff80079f00>] walk_stackframe+0x3e0/0x44e arch/riscv/kernel/stacktrace.c:67
[<ffffffff864103ee>] arch_stack_walk+0x1c/0x26 arch/riscv/kernel/stacktrace.c:165
[<ffffffff803df120>] stack_trace_save_tsk+0x16c/0x1f6 kernel/stacktrace.c:150
[<ffffffff80e73584>] proc_pid_stack+0x176/0x27e fs/proc/base.c:492
[<ffffffff80e7557e>] proc_single_show+0xea/0x1cc fs/proc/base.c:812
[<ffffffff80ce0416>] traverse.part.0.constprop.0+0x126/0x530 fs/seq_file.c:111
[<ffffffff80ce101e>] traverse fs/seq_file.c:98 [inline]
[<ffffffff80ce101e>] seq_read_iter+0x7fe/0x104a fs/seq_file.c:195
[<ffffffff80ce1b0a>] seq_read+0x2a0/0x41e fs/seq_file.c:162
[<ffffffff80c272ac>] vfs_read+0x2ee/0xbba fs/read_write.c:570
[<ffffffff80c29e08>] ksys_pread64 fs/read_write.c:763 [inline]
[<ffffffff80c29e08>] __do_sys_pread64 fs/read_write.c:771 [inline]
[<ffffffff80c29e08>] __se_sys_pread64 fs/read_write.c:768 [inline]
[<ffffffff80c29e08>] __riscv_sys_pread64+0x1d6/0x22c fs/read_write.c:768
[<ffffffff80078120>] syscall_handler+0x94/0x118 arch/riscv/include/asm/syscall.h:112
[<ffffffff8641019a>] do_trap_ecall_u+0x396/0x530 arch/riscv/kernel/traps.c:343
[<ffffffff86439abe>] handle_exception+0x146/0x152 arch/riscv/kernel/entry.S:198

The buggy address belongs to a 8-page vmalloc region starting at 0xffff8f8002e40000 allocated at kernel_clone+0x128/0xd9e kernel/fork.c:2605
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffffaf8000000000 pfn:0x99c86
memcg:ffffaf8013a9bb02
flags: 0xffe000000000000(node=0|zone=0|lastcpupid=0x7ff)
raw: 0ffe000000000000 0000000000000000 dead000000000122 0000000000000000
raw: ffffaf8000000000 0000000000000000 00000001ffffffff ffffaf8013a9bb02
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_ZERO|__GFP_NOWARN), pid 12559, tgid 12558 (syz.6.1129), ts 9559515990000, free_ts 9559313590700
 __set_page_owner+0x94/0x4a8 mm/page_owner.c:329
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0xdc/0x1ba mm/page_alloc.c:1851
 prep_new_page mm/page_alloc.c:1859 [inline]
 get_page_from_freelist+0x7fa/0x359a mm/page_alloc.c:3858
 __alloc_frozen_pages_noprof+0x22e/0x2120 mm/page_alloc.c:5148
 alloc_pages_mpol+0x1fa/0x5bc mm/mempolicy.c:2416
 alloc_frozen_pages_noprof+0x174/0x2f0 mm/mempolicy.c:2487
 alloc_pages_noprof+0x20/0x48 mm/mempolicy.c:2507
 vm_area_alloc_pages mm/vmalloc.c:3642 [inline]
 __vmalloc_area_node mm/vmalloc.c:3720 [inline]
 __vmalloc_node_range_noprof+0x624/0x11b0 mm/vmalloc.c:3893
 __vmalloc_node_noprof+0x104/0x136 mm/vmalloc.c:3956
 alloc_thread_stack_node kernel/fork.c:311 [inline]
 dup_task_struct kernel/fork.c:882 [inline]
 copy_process+0x32ec/0x72ce kernel/fork.c:2004
 kernel_clone+0x128/0xd9e kernel/fork.c:2605
 __do_sys_clone+0xfe/0x13e kernel/fork.c:2748
 __se_sys_clone kernel/fork.c:2716 [inline]
 __riscv_sys_clone+0xa0/0x10e kernel/fork.c:2716
 syscall_handler+0x94/0x118 arch/riscv/include/asm/syscall.h:112
 do_trap_ecall_u+0x396/0x530 arch/riscv/kernel/traps.c:343
 handle_exception+0x146/0x152 arch/riscv/kernel/entry.S:198
page last free pid 10975 tgid 10975 stack trace:
 __reset_page_owner+0x78/0x1ba mm/page_owner.c:308
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1395 [inline]
 __free_frozen_pages+0x836/0x145e mm/page_alloc.c:2895
 ___free_pages+0x146/0x1c8 mm/page_alloc.c:5229
 __free_pages+0xe/0x16 mm/page_alloc.c:5260
 pagetable_free include/linux/mm.h:2898 [inline]
 pagetable_dtor_free include/linux/mm.h:2996 [inline]
 __tlb_remove_table include/asm-generic/tlb.h:220 [inline]
 __tlb_remove_table_free mm/mmu_gather.c:227 [inline]
 tlb_remove_table_rcu+0xde/0x160 mm/mmu_gather.c:290
 rcu_do_batch kernel/rcu/tree.c:2605 [inline]
 rcu_core+0xa24/0x1ef8 kernel/rcu/tree.c:2861
 rcu_core_si+0xc/0x14 kernel/rcu/tree.c:2878
 handle_softirqs+0x4b2/0x132e kernel/softirq.c:579
 __do_softirq kernel/softirq.c:613 [inline]
 invoke_softirq kernel/softirq.c:453 [inline]
 __irq_exit_rcu+0x18c/0x550 kernel/softirq.c:680
 irq_exit_rcu+0x10/0xf8 kernel/softirq.c:696
 handle_riscv_irq+0x40/0x4c arch/riscv/kernel/traps.c:390
 call_on_irq_stack+0x32/0x40 arch/riscv/kernel/entry.S:361

Memory state around the buggy address:
 ffff8f8002e47480: f1 f1 f1 f1 f1 f1 04 f2 00 00 f2 f2 00 00 00 f3
 ffff8f8002e47500: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8f8002e47580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                                     ^
 ffff8f8002e47600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8f8002e47680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/25 23:05 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git for-next 0b0ca959d206 0abd0691 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 KASAN: out-of-bounds Read in proc_pid_stack
2025/06/29 23:51 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git for-next fda589c28604 fc9d8ee5 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 KASAN: out-of-bounds Read in proc_pid_stack
2025/09/14 10:25 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git for-next 8f5ae30d69d7 e2beed91 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 KASAN: stack-out-of-bounds Read in proc_pid_stack
* Struck through repros no longer work on HEAD.