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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-bb8d521f77f3e68a713456b7fb1e99f52ff3342c@git.kernel.org>
Date:   Tue, 11 Apr 2017 22:39:03 -0700
From:   tip-bot for David Carrillo-Cisneros <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     mingo@...nel.org, avagin@...nvz.org,
        alexander.shishkin@...ux.intel.com, hekuang@...wei.com,
        tglx@...utronix.de, wangnan0@...wei.com, ak@...ux.intel.com,
        sque@...omium.org, pjt@...gle.com, jolsa@...nel.org,
        davidcc@...gle.com, peterz@...radead.org, mhiramat@...nel.org,
        linux-kernel@...r.kernel.org, acme@...hat.com, eranian@...gle.com,
        hpa@...or.com
Subject: [tip:perf/core] perf inject: Don't proceed if
 perf_session__process_event() fails

Commit-ID:  bb8d521f77f3e68a713456b7fb1e99f52ff3342c
Gitweb:     http://git.kernel.org/tip/bb8d521f77f3e68a713456b7fb1e99f52ff3342c
Author:     David Carrillo-Cisneros <davidcc@...gle.com>
AuthorDate: Mon, 10 Apr 2017 13:14:26 -0700
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 11 Apr 2017 15:23:40 -0300

perf inject: Don't proceed if perf_session__process_event() fails

All paths following perf_session__process_event() in __cmd_inject() are
useless if __cmd_inject() is to fail, some depend on a correct
session->evlist.

First commit to add code that depends on session->evlist without checking
error was commmit e558a5bd8b ("perf inject: Work with files"). It has
grown since then.

Change __cmd_inject() to fail immediately after
perf_session__process_event() fails.

Signed-off-by: David Carrillo-Cisneros <davidcc@...gle.com>
Acked-by: Jiri Olsa <jolsa@...nel.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Andi Kleen <ak@...ux.intel.com>
Cc: Andrew Vagin <avagin@...nvz.org>
Cc: He Kuang <hekuang@...wei.com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Paul Turner <pjt@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Simon Que <sque@...omium.org>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Wang Nan <wangnan0@...wei.com>
Fixes: e558a5bd8b74 ("perf inject: Work with files")
Link: http://lkml.kernel.org/r/20170410201432.24807-2-davidcc@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/builtin-inject.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 42dff0b..65e1c02 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -694,6 +694,8 @@ static int __cmd_inject(struct perf_inject *inject)
 		lseek(fd, output_data_offset, SEEK_SET);
 
 	ret = perf_session__process_events(session);
+	if (ret)
+		return ret;
 
 	if (!file_out->is_pipe) {
 		if (inject->build_ids)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ