Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1610236
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 01/20] perf trace: Check for vfs_getname.pathname length |
| Date | 2017-03-28 03:50 +0200 |
| Message-ID | <tpOqL-f2-29@gated-at.bofh.it> (permalink) |
| References | <tpOqJ-f2-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
It shouldn't be zero, but if the 'perf probe' on getname_flags() (or
elsewhere in the future we need to probe to catch the pathname for
syscalls like 'open' being copied from userspace to the kernel) is
misplaced somehow, then we will end up not allocating space and trying
to copy the "" empty string to ttrace->filename.name, causing a
segfault, fix it.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-c4f1t6sx1nczuzop19r5si5s@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-trace.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 912fedc5b42d..33c657c15d5e 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1656,6 +1656,8 @@ static int trace__vfs_getname(struct trace *trace, struct perf_evsel *evsel,
goto out;
filename_len = strlen(filename);
+ if (filename_len == 0)
+ goto out;
if (ttrace->filename.namelen < filename_len) {
char *f = realloc(ttrace->filename.name, filename_len + 1);
--
2.9.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 08/20] perf report: Find the inline stack for a given address Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 20/20] perf utils: Readlink /proc/self/exe to find the perf binary Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 01/20] perf trace: Check for vfs_getname.pathname length Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 06/20] perf tools: Remove unused 'prefix' from builtin functions Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 12/20] perf report: Enable sorting by srcline as key Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 04/20] perf auxtrace: Fix no_size logic in addr_filter__resolve_kernel_syms() Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 13/20] perf annotate: Fix a bug following symbolic link of a build-id file Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 07/20] perf report: Refactor common code in srcline.c Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 19/20] perf utils: Null terminate buf in read_ftrace_printk() Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 17/20] perf tests: Do not assume that readlink() returns a null terminated string Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 16/20] perf buildid: Do not assume that readlink() returns a null terminated string Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 14/20] perf annotate: Fix a bug of division by zero when calculating percent Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 15/20] perf buildid: Do not update SDT cache with null filename Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 09/20] perf report: Introduce --inline option Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 11/20] perf report: Show inline stack for browser mode Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 03:50 +0200 [PATCH 10/20] perf report: Show inline stack for stdio mode Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-03-28 04:10 +0200 Re: [GIT PULL 00/20] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2017-03-28 07:50 +0200
csiph-web