lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 6 Sep 2016 15:42:40 +0200
From:   Dmitry Vyukov <dvyukov@...gle.com>
To:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        "H. Peter Anvin" <hpa@...or.com>,
        "x86@...nel.org" <x86@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: perf: out-of-bounds write in perf_callchain_store

Hello,

The following program trigger an out-of-bounds write in
perf_callchain_store (if run in a parallel loop):

https://gist.githubusercontent.com/dvyukov/c05d883e776a353a1d063b670f50bde6/raw/1c8906b1aacfbd8a0cc0b5cf0cc4d0535345e497/gistfile1.txt


BUG: KASAN: slab-out-of-bounds in perf_callchain_user+0xe65/0xfc0 at
addr ffff88003e162840
Write of size 8 by task syz-executor/22516
CPU: 0 PID: 22516 Comm: syz-executor Not tainted 4.8.0-rc5-next-20160905+ #14
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
 ffffffff886b6fe0 ffff88003ec07738 ffffffff82db81a9 ffffffff00000000
 fffffbfff10d6dfc ffff88003e800a00 ffff88003e161740 ffff88003e163740
 0000000000000001 ffff88003e162840 ffff88003ec07760 ffffffff8180b2ec
Call Trace:
 [<ffffffff8180b9c7>] __asan_report_store8_noabort+0x17/0x20
mm/kasan/report.c:332
 [<     inline     >] perf_callchain_store include/linux/perf_event.h:1146
 [<ffffffff81014925>] perf_callchain_user+0xe65/0xfc0
arch/x86/events/core.c:2441
 [<ffffffff816c5f48>] get_perf_callchain+0x448/0x680
kernel/events/callchain.c:235
 [<ffffffff816c62cd>] perf_callchain+0x14d/0x1a0 kernel/events/callchain.c:191
 [<ffffffff816bbf8f>] perf_prepare_sample+0x7df/0xfc0 kernel/events/core.c:5849
 [<     inline     >] __perf_event_output kernel/events/core.c:5962
 [<ffffffff816bc865>] perf_event_output_forward+0xf5/0x220
kernel/events/core.c:5980
 [<ffffffff81691d27>] __perf_event_overflow+0x1c7/0x530
kernel/events/core.c:7059
 [<ffffffff81692b00>] perf_swevent_hrtimer+0x210/0x350 kernel/events/core.c:8247
 [<     inline     >] __run_hrtimer kernel/time/hrtimer.c:1238
 [<ffffffff81504425>] __hrtimer_run_queues+0x325/0xe70
kernel/time/hrtimer.c:1302
 [<ffffffff81506ddb>] hrtimer_interrupt+0x18b/0x420 kernel/time/hrtimer.c:1336
 [<ffffffff8126ceff>] local_apic_timer_interrupt+0x6f/0xe0
arch/x86/kernel/apic/apic.c:933
 [<ffffffff86e1d216>] smp_apic_timer_interrupt+0x76/0xa0
arch/x86/kernel/apic/apic.c:957
 [<ffffffff86e1c2cc>] apic_timer_interrupt+0x8c/0xa0
arch/x86/entry/entry_64.S:487
 <EOI>
Object at ffff88003e161740, in cache kmalloc-8192 size: 8192
Allocated:
PID = 22520
 [<ffffffff8122f486>] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:67
 [<ffffffff8180a6d6>] save_stack+0x46/0xd0 mm/kasan/kasan.c:479
 [<     inline     >] set_track mm/kasan/kasan.c:491
 [<ffffffff8180a94d>] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:582
 [<     inline     >] __do_kmalloc_node mm/slab.c:3709
 [<ffffffff81807b47>] __kmalloc_node+0x47/0x70 mm/slab.c:3716
 [<     inline     >] kmalloc_node include/linux/slab.h:532
 [<     inline     >] alloc_callchain_buffers kernel/events/callchain.c:89
 [<ffffffff816c5877>] get_callchain_buffers+0x1a7/0x3d0
kernel/events/callchain.c:136
 [<ffffffff816ac778>] perf_event_alloc+0x1cb8/0x24b0 kernel/events/core.c:9187
 [<ffffffff816b6084>] SYSC_perf_event_open+0x674/0x2250
kernel/events/core.c:9576
 [<ffffffff816bed89>] SyS_perf_event_open+0x39/0x50 kernel/events/core.c:9470
 [<ffffffff86e1a8c0>] entry_SYSCALL_64_fastpath+0x23/0xc1
Memory state around the buggy address:
 ffff88003e162700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88003e162780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88003e162800: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
                                           ^
 ffff88003e162880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88003e162900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


On commit 0693c28cfc8e25f18c25b65a8942c026f1854a3c (Sep 5) of linux-next.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ