Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1408154 > unrolled thread
| Started by | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| First post | 2016-05-27 18:00 +0200 |
| Last post | 2016-05-27 18:00 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-05-27 18:00 +0200
[PATCH 2/3] perf record: Fix crash when kptr is restricted Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-05-27 18:00 +0200
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-05-27 18:00 +0200 |
| Subject | [GIT PULL 0/3] perf/urgent fixes |
| Message-ID | <rDsl4-5l0-3@gated-at.bofh.it> |
Hi Ingo,
Please consider pulling,
- Arnaldo
The following changes since commit 275ae411e56f8f900fa364da29c4706f9af4e1f3:
perf/x86/intel/rapl: Fix pmus free during cleanup (2016-05-25 10:56:43 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-urgent-for-mingo-20160527
for you to fetch changes up to 5ea5888b2fbf5b230da62b2a21c8247bebb6c9cf:
perf ctf: Convert invalid chars in a string before set value (2016-05-27 12:08:40 -0300)
----------------------------------------------------------------
perf/urgent fixes:
- Fix kptr_restrict=2 related 'perf record' segfault (Wang Nan)
- Fix CTF/libbabeltrace handling of chinese COMM strings (Wang Nan)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Wang Nan (3):
perf symbols: Check kptr_restrict for root
perf record: Fix crash when kptr is restricted
perf ctf: Convert invalid chars in a string before set value
tools/perf/util/data-convert-bt.c | 41 +++++++++++++++++++++++++++++++++++++--
tools/perf/util/event.c | 2 ++
tools/perf/util/symbol.c | 16 +++++++--------
3 files changed, 49 insertions(+), 10 deletions(-)
[toc] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-05-27 18:00 +0200 |
| Subject | [PATCH 2/3] perf record: Fix crash when kptr is restricted |
| Message-ID | <rDsl4-5l0-15@gated-at.bofh.it> |
| In reply to | #1408154 |
From: Wang Nan <wangnan0@huawei.com>
Before this patch, a simple 'perf record' could fail if kptr_restrict is
set to 1 (for normal user) or 2 (for root):
# perf record ls
WARNING: Kernel address maps (/proc/{kallsyms,modules}) are restricted,
check /proc/sys/kernel/kptr_restrict.
Samples in kernel functions may not be resolved if a suitable vmlinux
file is not found in the buildid cache or in the vmlinux path.
Samples in kernel modules won't be resolved at all.
If some relocation was applied (e.g. kexec) symbols may be misresolved
even with a suitable vmlinux or kallsyms file.
Segmentation fault (core dumped)
This patch skips perf_event__synthesize_kernel_mmap() when kptr is not
available.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Fixes: 45e90056904b ("perf machine: Do not bail out if not managing to read ref reloc symbol")
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1464081688-167940-2-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/event.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index f6fcc6832949..9b141f12329e 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -673,6 +673,8 @@ int perf_event__synthesize_kernel_mmap(struct perf_tool *tool,
int err;
union perf_event *event;
+ if (symbol_conf.kptr_restrict)
+ return -1;
if (map == NULL)
return -1;
--
2.5.5
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web