KASAN: stack-out-of-bounds Read in update_stack_state

10 views
Skip to first unread message

syzbot

unread,
Aug 27, 2019, 8:47:08 AM8/27/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: b5260801 Linux 4.14.140
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1072ca7a600000
kernel config: https://syzkaller.appspot.com/x/.config?x=a1845e2543d718e1
dashboard link: https://syzkaller.appspot.com/bug?extid=13330e78888c1d1255c6
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

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

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+13330e...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: stack-out-of-bounds in update_stack_state+0x54d/0x590
arch/x86/kernel/unwind_frame.c:266
Read of size 8 at addr ffff8880556afd20 by task syz-executor.1/7142

CPU: 0 PID: 7142 Comm: syz-executor.1 Not tainted 4.14.140 #36
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x138/0x197 lib/dump_stack.c:53
print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
kasan_report_error mm/kasan/report.c:351 [inline]
kasan_report mm/kasan/report.c:409 [inline]
kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
update_stack_state+0x54d/0x590 arch/x86/kernel/unwind_frame.c:266
unwind_next_frame.part.0+0x188/0x8b0 arch/x86/kernel/unwind_frame.c:333
unwind_next_frame+0x3b/0x50 arch/x86/kernel/unwind_frame.c:287
__save_stack_trace+0x6b/0xd0 arch/x86/kernel/stacktrace.c:44
save_stack_trace_tsk arch/x86/kernel/stacktrace.c:73 [inline]
save_stack_trace_tsk+0x3e/0x50 arch/x86/kernel/stacktrace.c:68
proc_pid_stack+0x174/0x250 fs/proc/base.c:459
proc_single_show+0xf0/0x160 fs/proc/base.c:761
seq_read+0x51a/0x1280 fs/seq_file.c:237
do_loop_readv_writev fs/read_write.c:695 [inline]
do_loop_readv_writev fs/read_write.c:682 [inline]
do_iter_read+0x3e2/0x5b0 fs/read_write.c:919
vfs_readv+0xd3/0x130 fs/read_write.c:981
do_preadv+0x15d/0x200 fs/read_write.c:1065
SYSC_preadv fs/read_write.c:1115 [inline]
SyS_preadv+0x31/0x40 fs/read_write.c:1110
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x459879
RSP: 002b:00007fcb451a4c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000127
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000459879
RDX: 0000000000000199 RSI: 00000000200017c0 RDI: 0000000000000005
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fcb451a56d4
R13: 00000000004c6b98 R14: 00000000004dbd88 R15: 00000000ffffffff

The buggy address belongs to the page:
page:ffffea000155abc0 count:0 mapcount:0 mapping: (null) index:0x0
flags: 0x1fffc0000000000()
raw: 01fffc0000000000 0000000000000000 0000000000000000 00000000ffffffff
raw: ffffea000155abe0 ffffea000155abe0 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880556afc00: 00 00 00 00 00 00 f1 f1 f1 f1 00 00 f3 f3 00 00
ffff8880556afc80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1
> ffff8880556afd00: f1 f1 f1 00 f2 f2 f2 00 00 f3 f3 00 00 00 00 00
^
ffff8880556afd80: 00 00 00 00 00 f1 f1 f1 f1 f1 f1 00 00 00 00 00
ffff8880556afe00: 00 00 00 00 f3 f3 f3 f3 f3 00 00 00 00 00 00 00
==================================================================


---
This bug 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 bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Jan 17, 2020, 3:59:11 PM1/17/20
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following crash on:

HEAD commit: c1141b3a Linux 4.14.166
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14147e35e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=a99b4b74c4c01851
dashboard link: https://syzkaller.appspot.com/bug?extid=13330e78888c1d1255c6
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1578c166e00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=164193b9e00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+13330e...@syzkaller.appspotmail.com

audit: type=1400 audit(1579294528.541:36): avc: denied { map } for pid=7324 comm="syz-executor374" path="/root/syz-executor374653520" dev="sda1" ino=16484 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
==================================================================
BUG: KASAN: stack-out-of-bounds in __read_once_size include/linux/compiler.h:183 [inline]
BUG: KASAN: stack-out-of-bounds in update_stack_state+0x522/0x590 arch/x86/kernel/unwind_frame.c:270
Read of size 8 at addr ffff88808e487380 by task syz-executor374/7329

CPU: 0 PID: 7329 Comm: syz-executor374 Not tainted 4.14.166-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x142/0x197 lib/dump_stack.c:58
print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
kasan_report_error mm/kasan/report.c:351 [inline]
kasan_report mm/kasan/report.c:409 [inline]
kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
__read_once_size include/linux/compiler.h:183 [inline]
update_stack_state+0x522/0x590 arch/x86/kernel/unwind_frame.c:270
__unwind_start+0x189/0x3d0 arch/x86/kernel/unwind_frame.c:423
unwind_start arch/x86/include/asm/unwind.h:60 [inline]
perf_callchain_kernel+0x26e/0x510 arch/x86/events/core.c:2342
get_perf_callchain+0x30a/0x7c0 kernel/events/callchain.c:217
perf_callchain+0x14e/0x1a0 kernel/events/callchain.c:190
perf_prepare_sample+0x77c/0x1350 kernel/events/core.c:6143
__perf_event_output kernel/events/core.c:6259 [inline]
perf_event_output_forward+0xe7/0x200 kernel/events/core.c:6277
__perf_event_overflow+0x11e/0x330 kernel/events/core.c:7515
perf_swevent_overflow+0x17c/0x210 kernel/events/core.c:7591
perf_swevent_event+0x1ac/0x280 kernel/events/core.c:7624
do_perf_sw_event kernel/events/core.c:7732 [inline]
___perf_sw_event+0x295/0x470 kernel/events/core.c:7763
perf_sw_event_sched include/linux/perf_event.h:1063 [inline]
perf_event_task_sched_out include/linux/perf_event.h:1101 [inline]
prepare_task_switch kernel/sched/core.c:2601 [inline]
context_switch kernel/sched/core.c:2773 [inline]
__schedule+0xcc0/0x1cd0 kernel/sched/core.c:3384
schedule+0x92/0x1c0 kernel/sched/core.c:3428
freezable_schedule include/linux/freezer.h:172 [inline]
futex_wait_queue_me+0x2ec/0x5a0 kernel/futex.c:2705
futex_wait+0x1f9/0x580 kernel/futex.c:2820
do_futex+0x14a/0x19e0 kernel/futex.c:3903
SYSC_futex kernel/futex.c:3963 [inline]
SyS_futex+0x215/0x310 kernel/futex.c:3931
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x446849
RSP: 002b:00007f7db89fadb8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: ffffffffffffffda RBX: 00000000006dbc28 RCX: 0000000000446849
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00000000006dbc28
RBP: 00000000006dbc20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dbc2c
R13: 00007ffd4d4a0cdf R14: 00007f7db89fb9c0 R15: 20c49ba5e353f7cf

The buggy address belongs to the page:
page:ffffea00023921c0 count:0 mapcount:0 mapping: (null) index:0x0
flags: 0xfffe0000000000()
raw: 00fffe0000000000 0000000000000000 0000000000000000 00000000ffffffff
raw: 0000000000000000 0000000100000001 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88808e487280: 00 00 00 00 00 00 f3 f3 f3 f3 00 00 00 00 00 00
ffff88808e487300: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 f3
>ffff88808e487380: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
^
ffff88808e487400: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
ffff88808e487480: 00 f3 f3 f3 00 00 00 00 00 00 00 00 f1 f1 f1 f1
==================================================================

Reply all
Reply to author
Forward
0 new messages