[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160106111549.GD17939@krava.brq.redhat.com>
Date: Wed, 6 Jan 2016 12:15:49 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Wang Nan <wangnan0@...wei.com>
Cc: jolsa@...nel.org, acme@...nel.org, linux-kernel@...r.kernel.org,
pi3orama@....com, lizefan@...wei.com,
Arnaldo Carvalho de Melo <acme@...hat.com>,
He Kuang <hekuang@...wei.com>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
Namhyung Kim <namhyung@...nel.org>
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@...nel.org>
thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists