[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-3c028a0cb5b71f47d523bc8ad2c597cb257f41fb@git.kernel.org>
Date: Tue, 20 Sep 2016 14:45:54 -0700
From: tip-bot for Jiri Olsa <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, namhyung@...nel.org, jmario@...hat.com,
hpa@...or.com, a.p.zijlstra@...llo.nl, mingo@...nel.org,
jolsa@...hat.com, linux-kernel@...r.kernel.org, jolsa@...nel.org,
tglx@...utronix.de, dzickus@...hat.com, andi@...stfloor.org,
dsahern@...il.com
Subject: [tip:perf/core] perf symbols: Do not open device files
Commit-ID: 3c028a0cb5b71f47d523bc8ad2c597cb257f41fb
Gitweb: http://git.kernel.org/tip/3c028a0cb5b71f47d523bc8ad2c597cb257f41fb
Author: Jiri Olsa <jolsa@...hat.com>
AuthorDate: Tue, 20 Sep 2016 18:12:45 +0200
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 20 Sep 2016 16:20:21 -0300
perf symbols: Do not open device files
The dso__read_binary_type_filename gets the dso's file name to open. We
need to check it for regular file before trying to open it, otherwise we
might get stuck with device file.
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Cc: Andi Kleen <andi@...stfloor.org>
Cc: David Ahern <dsahern@...il.com>
Cc: Don Zickus <dzickus@...hat.com>
Cc: Joe Mario <jmario@...hat.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Link: http://lkml.kernel.org/r/20160920161245.GA8995@krava
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/dso.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 774f6ec..d2c6cdd 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -363,6 +363,9 @@ static int __open_dso(struct dso *dso, struct machine *machine)
return -EINVAL;
}
+ if (!is_regular_file(name))
+ return -EINVAL;
+
fd = do_open(name);
free(name);
return fd;
Powered by blists - more mailing lists