From: Jiri Olsa <jolsa@redhat.com>
To: Wang Nan <wangnan0@huawei.com>
Cc: jolsa@kernel.org, acme@kernel.org, linux-kernel@vger.kernel.org,
pi3orama@163.com, lizefan@huawei.com,
Arnaldo Carvalho de Melo <acme@redhat.com>,
He Kuang <hekuang@huawei.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH] perf tools: Fix mmap2 event allocation in synthesize code
Date: Wed, 6 Jan 2016 12:15:49 +0100 [thread overview]
Message-ID: <20160106111549.GD17939@krava.brq.redhat.com> (raw)
In-Reply-To: <1452051683-21916-1-git-send-email-wangnan0@huawei.com>
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
prev parent reply other threads:[~2016-01-06 11:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 3:41 Wang Nan
2016-01-06 11:15 ` Jiri Olsa [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160106111549.GD17939@krava.brq.redhat.com \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=hekuang@huawei.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=namhyung@kernel.org \
--cc=pi3orama@163.com \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®