syzbot


KASAN: out-of-bounds Read in proc_pid_stack

Status: closed as dup on 2025/01/06 10:20
Subsystems: fuse
[Documentation on labels]
Reported-by: syzbot+2886d86a850adcd36196@syzkaller.appspotmail.com
First crash: 142d, last: 74d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
kernel BUG in iov_iter_revert (2) fuse netfs C done 61 69d 140d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [fuse?] KASAN: out-of-bounds Read in proc_pid_stack 2 (4) 2025/01/06 10:20
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: stack-out-of-bounds Read in proc_pid_stack (2) fs 1 250d 209d 0/28 auto-obsoleted due to no activity on 2024/10/21 18:27
upstream KASAN: stack-out-of-bounds Read in proc_pid_stack riscv 3 654d 688d 22/28 fixed on 2023/06/08 14:41
Last patch testing requests (1)
Created Duration User Patch Repo Result
2025/01/06 09:24 47m miklos@szeredi.hu git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git 7a4f5418 OK log

Sample crash report:
==================================================================
BUG: KASAN: out-of-bounds in walk_stackframe+0x3f0/0x452 arch/riscv/kernel/stacktrace.c:66
Read of size 8 at addr ff20000001f17d68 by task syz.3.225/5073

CPU: 0 UID: 0 PID: 5073 Comm: syz.3.225 Not tainted 6.13.0-rc2-syzkaller-g21f1b85c8912 #0
Hardware name: riscv-virtio,qemu (DT)
Call Trace:
[<ffffffff80071bae>] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:130
[<ffffffff8000325c>] show_stack+0x30/0x3c arch/riscv/kernel/stacktrace.c:136
[<ffffffff8005e1f4>] __dump_stack lib/dump_stack.c:94 [inline]
[<ffffffff8005e1f4>] dump_stack_lvl+0x12e/0x1a6 lib/dump_stack.c:120
[<ffffffff8000d250>] print_address_description mm/kasan/report.c:378 [inline]
[<ffffffff8000d250>] print_report+0x28e/0x5a8 mm/kasan/report.c:489
[<ffffffff80a1a0fe>] kasan_report+0xec/0x118 mm/kasan/report.c:602
[<ffffffff80a1bf64>] __asan_report_load8_noabort+0x12/0x1a mm/kasan/report_generic.c:381
[<ffffffff8007178a>] walk_stackframe+0x3f0/0x452 arch/riscv/kernel/stacktrace.c:66
[<ffffffff861c20d4>] arch_stack_walk+0x1c/0x24 arch/riscv/kernel/stacktrace.c:163
[<ffffffff803a7e92>] stack_trace_save_tsk+0x16c/0x1f6 kernel/stacktrace.c:150
[<ffffffff80cfbfc2>] proc_pid_stack+0x176/0x27e fs/proc/base.c:492
[<ffffffff80cfd524>] proc_single_show+0xf0/0x20e fs/proc/base.c:812
[<ffffffff80b80784>] traverse.part.0.constprop.0+0x126/0x530 fs/seq_file.c:111
[<ffffffff80b81372>] traverse fs/seq_file.c:98 [inline]
[<ffffffff80b81372>] seq_read_iter+0x7e4/0x101e fs/seq_file.c:195
[<ffffffff80b81e4a>] seq_read+0x29e/0x360 fs/seq_file.c:162
[<ffffffff80ac99b6>] do_loop_readv_writev fs/read_write.c:840 [inline]
[<ffffffff80ac99b6>] do_loop_readv_writev fs/read_write.c:828 [inline]
[<ffffffff80ac99b6>] vfs_readv+0x520/0x70c fs/read_write.c:1013
[<ffffffff80aca05c>] do_preadv+0x1b4/0x250 fs/read_write.c:1125
[<ffffffff80ad0718>] __do_sys_preadv fs/read_write.c:1172 [inline]
[<ffffffff80ad0718>] __se_sys_preadv fs/read_write.c:1167 [inline]
[<ffffffff80ad0718>] __riscv_sys_preadv+0x88/0xc4 fs/read_write.c:1167
[<ffffffff80070302>] syscall_handler+0x94/0x118 arch/riscv/include/asm/syscall.h:90
[<ffffffff861c1fae>] do_trap_ecall_u+0x1aa/0x216 arch/riscv/kernel/traps.c:331
[<ffffffff861e652a>] _new_vmalloc_restore_context_a0+0xc2/0xce

The buggy address belongs to the virtual mapping at
 [ff20000001f10000, ff20000001f19000) created by:
 kernel_clone+0x11e/0xc3c kernel/fork.c:2807

The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x9d543
memcg:ff6000001926ed82
flags: 0xffe000000000000(node=0|zone=0|lastcpupid=0x7ff)
raw: 0ffe000000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff ff6000001926ed82
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 5065, tgid 5065 (syz.3.222), ts 1917899182200, free_ts 1915638108000
 __set_page_owner+0xa2/0x70c mm/page_owner.c:320
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0xf0/0x1e8 mm/page_alloc.c:1556
 prep_new_page mm/page_alloc.c:1564 [inline]
 get_page_from_freelist+0xdb2/0x2c12 mm/page_alloc.c:3474
 __alloc_pages_noprof+0x1e8/0x1fc0 mm/page_alloc.c:4751
 alloc_pages_mpol_noprof+0xf8/0x488 mm/mempolicy.c:2269
 alloc_pages_noprof+0x174/0x2f0 mm/mempolicy.c:2348
 vm_area_alloc_pages mm/vmalloc.c:3589 [inline]
 __vmalloc_area_node mm/vmalloc.c:3667 [inline]
 __vmalloc_node_range_noprof+0x642/0x120c mm/vmalloc.c:3844
 alloc_thread_stack_node kernel/fork.c:314 [inline]
 dup_task_struct kernel/fork.c:1121 [inline]
 copy_process+0x2c04/0x6c90 kernel/fork.c:2225
 kernel_clone+0x11e/0xc3c kernel/fork.c:2807
 __do_sys_clone+0xe4/0x118 kernel/fork.c:2950
 __se_sys_clone kernel/fork.c:2918 [inline]
 __riscv_sys_clone+0xa0/0x10e kernel/fork.c:2918
 syscall_handler+0x94/0x118 arch/riscv/include/asm/syscall.h:90
 do_trap_ecall_u+0x1aa/0x216 arch/riscv/kernel/traps.c:331
 _new_vmalloc_restore_context_a0+0xc2/0xce
page last free pid 4315 tgid 4315 stack trace:
 __reset_page_owner+0x8c/0x400 mm/page_owner.c:297
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1127 [inline]
 free_unref_page+0x61e/0x11d6 mm/page_alloc.c:2657
 __free_pages+0x13a/0x1ba mm/page_alloc.c:4838
 bpf_ringbuf_free kernel/bpf/ringbuf.c:226 [inline]
 ringbuf_map_free+0xc8/0x134 kernel/bpf/ringbuf.c:235
 bpf_map_free kernel/bpf/syscall.c:839 [inline]
 bpf_map_free_deferred+0x21e/0x46a kernel/bpf/syscall.c:863
 process_one_work+0x968/0x1f38 kernel/workqueue.c:3229
 process_scheduled_works kernel/workqueue.c:3310 [inline]
 worker_thread+0x5be/0xdc6 kernel/workqueue.c:3391
 kthread+0x28c/0x3a4 kernel/kthread.c:389
 ret_from_fork+0xe/0x18 arch/riscv/kernel/entry.S:326

Memory state around the buggy address:
 ff20000001f17c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ff20000001f17c80: f1 f1 f1 f1 04 f3 f3 f3 00 00 00 00 00 00 00 00
>ff20000001f17d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                                                             ^
 ff20000001f17d80: f1 f1 f1 f1 00 f2 f2 f2 00 00 f3 f3 00 00 00 00
 ff20000001f17e00: 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/01/06 01:14 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 21f1b85c8912 f3558dbf .config console log report syz / log [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 KASAN: out-of-bounds Read in proc_pid_stack
2025/01/04 19:10 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 21f1b85c8912 f3558dbf .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 KASAN: out-of-bounds Read in proc_pid_stack
2024/10/30 04:26 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 5f153a692bac 66aeb999 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 KASAN: out-of-bounds Read in proc_pid_stack
* Struck through repros no longer work on HEAD.