syzbot


KASAN: stack-out-of-bounds Read in unwind_next_frame (3)

Status: moderation: reported on 2025/01/08 17:12
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+a516fe79028c1604af82@syzkaller.appspotmail.com
First crash: 10d, last: 10d
Similar bugs (8)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: stack-out-of-bounds Read in unwind_next_frame C 1039 687d 1946d 0/1 upstream: reported C repro on 2019/09/18 00:47
android-54 KASAN: stack-out-of-bounds Read in unwind_next_frame C 49 1294d 1797d 0/2 auto-obsoleted due to no activity on 2023/04/20 07:24
android-49 KASAN: stack-out-of-bounds Read in unwind_next_frame 5 2353d 2588d 0/3 auto-closed as invalid on 2019/02/22 14:33
linux-4.19 KASAN: stack-out-of-bounds Read in unwind_next_frame C error 525 699d 1784d 0/1 upstream: reported C repro on 2020/02/26 18:51
upstream KASAN: stack-out-of-bounds Read in unwind_next_frame kernel C 929 664d 2401d 0/28 closed as dup on 2018/06/20 07:51
upstream KASAN: stack-out-of-bounds Read in unwind_next_frame (2) kernel 1 206d 202d 0/28 auto-obsoleted due to no activity on 2024/08/21 14:38
android-414 KASAN: stack-out-of-bounds Read in unwind_next_frame C 2192 1868d 2106d 0/1 public: reported C repro on 2019/04/11 00:00
android-54 KASAN: out-of-bounds Read in unwind_next_frame 16 1218d 1724d 0/2 auto-closed as invalid on 2022/01/13 05:16

Sample crash report:
==================================================================
BUG: KASAN: stack-out-of-bounds in user_mode arch/x86/include/asm/ptrace.h:214 [inline]
BUG: KASAN: stack-out-of-bounds in unwind_next_frame+0x1ad1/0x22d0 arch/x86/kernel/unwind_orc.c:482
Read of size 2 at addr ffffc9000c20f430 by task syz.1.2167/14955

CPU: 1 UID: 0 PID: 14955 Comm: syz.1.2167 Not tainted 6.13.0-rc5-syzkaller-00161-g63676eefb7a0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0x169/0x550 mm/kasan/report.c:489
 kasan_report+0x143/0x180 mm/kasan/report.c:602
 user_mode arch/x86/include/asm/ptrace.h:214 [inline]
 unwind_next_frame+0x1ad1/0x22d0 arch/x86/kernel/unwind_orc.c:482
 arch_stack_walk+0x11c/0x150 arch/x86/kernel/stacktrace.c:25
 stack_trace_save_tsk+0x24b/0x3d0 kernel/stacktrace.c:150
 proc_pid_stack+0x12c/0x1e0 fs/proc/base.c:492
 proc_single_show+0xff/0x1d0 fs/proc/base.c:812
 traverse+0x1e1/0x550 fs/seq_file.c:111
 seq_read_iter+0xc8c/0xd70 fs/seq_file.c:195
 seq_read+0x3a9/0x4f0 fs/seq_file.c:162
 vfs_read+0x1fe/0xb70 fs/read_write.c:563
 ksys_pread64 fs/read_write.c:756 [inline]
 __do_sys_pread64 fs/read_write.c:764 [inline]
 __se_sys_pread64 fs/read_write.c:761 [inline]
 __x64_sys_pread64+0x1ac/0x240 fs/read_write.c:761
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f5100385d29
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f51011f2038 EFLAGS: 00000246 ORIG_RAX: 0000000000000011
RAX: ffffffffffffffda RBX: 00007f5100576160 RCX: 00007f5100385d29
RDX: 0000000000001005 RSI: 0000000020001580 RDI: 000000000000000b
RBP: 00007f5100401b08 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000000000a R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f5100576160 R15: 00007ffe8dc42ec8
 </TASK>

The buggy address belongs to the virtual mapping at
 [ffffc9000c208000, ffffc9000c211000) created by:
 copy_process+0x5d1/0x3d50 kernel/fork.c:2224

The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x38592
memcg:ffff88802fb63482
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff ffff88802fb63482
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 14937, tgid 14936 (syz.1.2167), ts 965469818304, free_ts 963821684441
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1558
 prep_new_page mm/page_alloc.c:1566 [inline]
 get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3476
 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4753
 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2269
 vm_area_alloc_pages mm/vmalloc.c:3591 [inline]
 __vmalloc_area_node mm/vmalloc.c:3669 [inline]
 __vmalloc_node_range_noprof+0x9c9/0x1380 mm/vmalloc.c:3846
 alloc_thread_stack_node kernel/fork.c:314 [inline]
 dup_task_struct+0x444/0x8c0 kernel/fork.c:1116
 copy_process+0x5d1/0x3d50 kernel/fork.c:2224
 kernel_clone+0x226/0x8e0 kernel/fork.c:2806
 __do_sys_clone kernel/fork.c:2949 [inline]
 __se_sys_clone kernel/fork.c:2933 [inline]
 __x64_sys_clone+0x258/0x2a0 kernel/fork.c:2933
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 14929 tgid 14922 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1127 [inline]
 free_unref_page+0xd3f/0x1010 mm/page_alloc.c:2659
 vfree+0x1c3/0x360 mm/vmalloc.c:3383
 free_partitions block/partitions/core.c:113 [inline]
 blk_add_partitions block/partitions/core.c:638 [inline]
 bdev_disk_changed+0xf3e/0x13f0 block/partitions/core.c:693
 loop_reread_partitions drivers/block/loop.c:534 [inline]
 loop_set_status+0x70c/0x8f0 drivers/block/loop.c:1302
 lo_ioctl+0xcbc/0x1f50
 blkdev_ioctl+0x57f/0x6a0 block/ioctl.c:693
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:906 [inline]
 __se_sys_ioctl+0xf7/0x170 fs/ioctl.c:892
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffffc9000c20f300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffc9000c20f380: f1 f1 f1 f1 00 00 00 f2 f2 f2 f2 f2 04 f2 00 f2
>ffffc9000c20f400: f2 f2 00 00 f3 f3 f3 f3 00 00 00 00 00 00 00 00
                                     ^
 ffffc9000c20f480: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f3 f3 f3
 ffffc9000c20f500: 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
2025/01/04 17:07 upstream 63676eefb7a0 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: stack-out-of-bounds Read in unwind_next_frame
* Struck through repros no longer work on HEAD.