Messages in this thread | | | Date | Wed, 6 Jan 2016 12:15:49 +0100 | From | Jiri Olsa <> | Subject | Re: [PATCH] perf tools: Fix mmap2 event allocation in synthesize code |
| |
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
| |