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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1432040746-1755-6-git-send-email-adrian.hunter@intel.com>
Date:	Tue, 19 May 2015 16:05:46 +0300
From:	Adrian Hunter <adrian.hunter@...el.com>
To:	Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:	linux-kernel@...r.kernel.org, Jiri Olsa <jolsa@...hat.com>,
	Namhyung Kim <namhyung@...il.com>
Subject: [PATCH 5/5] perf tools: Fix data_read_offset() file opening

Patch "perf tools: Protect dso cache fd with a mutex"
changed data_file_size() to open the data file if it
was not open.

data_read_offset() was calling data_file_size() to read
the data file size, but data_file_size() can fail to
open the file because the binary_type has not been set up.

The correct function to call is dso__data_size() which
uses dso__data_fd() to open the file correctly.

Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
---
 tools/perf/util/dso.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 1b96c8d..e248f56 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -756,7 +756,7 @@ off_t dso__data_size(struct dso *dso, struct machine *machine)
 static ssize_t data_read_offset(struct dso *dso, struct machine *machine,
 				u64 offset, u8 *data, ssize_t size)
 {
-	if (data_file_size(dso, machine))
+	if (dso__data_size(dso, machine) < 0)
 		return -1;
 
 	/* Check the offset sanity. */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ