lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-c4f1t6sx1nczuzop19r5si5s@git.kernel.org>
Date:   Mon, 27 Mar 2017 22:49:06 -0700
From:   tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     jolsa@...nel.org, acme@...hat.com, wangnan0@...wei.com,
        linux-kernel@...r.kernel.org, mingo@...nel.org, tglx@...utronix.de,
        hpa@...or.com, dsahern@...il.com, namhyung@...nel.org,
        adrian.hunter@...el.com
Subject: [tip:perf/core] perf trace: Check for vfs_getname.pathname length

Commit-ID:  39f0e7a825cfc971dc9ad40b0770c22f6f4f89b8
Gitweb:     http://git.kernel.org/tip/39f0e7a825cfc971dc9ad40b0770c22f6f4f89b8
Author:     Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Fri, 24 Mar 2017 14:51:28 -0300
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 24 Mar 2017 16:05:31 -0300

perf trace: Check for vfs_getname.pathname length

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@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/n/tip-c4f1t6sx1nczuzop19r5si5s@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.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 912fedc..33c657c 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);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ