Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1302686

Re: [PATCH] perf tools: Fix mmap2 event allocation in synthesize code

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] perf tools: Fix mmap2 event allocation in synthesize code
Date 2016-01-06 12:20 +0100
Message-ID <qNUig-nA-79@gated-at.bofh.it> (permalink)
References <qNNgK-45J-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jan 06, 2016 at 03:41:23AM +0000, Wang Nan wrote:
> perf_event__synthesize_mmap_events() issues mmap2 events, but the
> memory of that event is allocated using:
> 
>  mmap_event = malloc(sizeof(mmap_event->mmap) + machine->id_hdr_size);
> 
> If path of mmap source file is long (near PATH_MAX), random crash
> would happen. Should use sizeof(mmap_event->mmap2).
> 
> Fix two memory allocations and rename all mmap_event to mmap2_event
> to make it clear.

nice one..

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] perf tools: Fix mmap2 event allocation in synthesize code Wang Nan <wangnan0@huawei.com> - 2016-01-06 04:50 +0100
  Re: [PATCH] perf tools: Fix mmap2 event allocation in synthesize code Jiri Olsa <jolsa@redhat.com> - 2016-01-06 12:20 +0100

csiph-web