From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Namhyung Kim <namhyung@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
David Ahern <dsahern@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
kernel-team@lge.com, Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 2/5] perf machine: Fix paranoid check in machine__set_kernel_mmap()
Date: Tue, 20 Feb 2018 22:34:28 -0300 [thread overview]
Message-ID: <20180221013431.11738-3-acme@kernel.org> (raw)
In-Reply-To: <20180221013431.11738-1-acme@kernel.org>
From: Namhyung Kim <namhyung@kernel.org>
The machine__set_kernel_mmap() is to setup addresses of the kernel map
using external info. But it has a check when the address is given from
an incorrect input which should have the start and end address of 0
(i.e. machine__process_kernel_mmap_event).
But we also use the end address of 0 for a valid input so change it to
check both start and end addresses.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: kernel-team@lge.com
Link: http://lkml.kernel.org/r/20180219101936.GD1583@sejong
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/machine.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index fe27ef55cbb9..12b7427444a3 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1226,7 +1226,7 @@ static void machine__set_kernel_mmap(struct machine *machine,
* Be a bit paranoid here, some perf.data file came with
* a zero sized synthesized MMAP event for the kernel.
*/
- if (machine->vmlinux_maps[i]->end == 0)
+ if (start == 0 && end == 0)
machine->vmlinux_maps[i]->end = ~0ULL;
}
}
--
2.14.3
next prev parent reply other threads:[~2018-02-21 1:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-21 1:34 [GIT PULL 0/5] perf/core improvements and fixes Arnaldo Carvalho de Melo
2018-02-21 1:34 ` [PATCH 1/5] perf s390: Fix reading cpuid model information Arnaldo Carvalho de Melo
2018-02-21 1:34 ` Arnaldo Carvalho de Melo [this message]
2018-02-21 1:34 ` [PATCH 3/5] perf ftrace: Append an EOL when write tracing files Arnaldo Carvalho de Melo
2018-02-21 1:34 ` [PATCH 4/5] perf python: Make twatch.py work with both python2 and python3 Arnaldo Carvalho de Melo
2018-02-21 1:34 ` [PATCH 5/5] perf tools: Add Python 3 support Arnaldo Carvalho de Melo
2018-02-21 7:52 ` [GIT PULL 0/5] perf/core improvements and fixes Ingo Molnar
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=20180221013431.11738-3-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=dsahern@gmail.com \
--cc=kernel-team@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).