projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e3b60bc
)
perf symbols: Do not open device files
author
Jiri Olsa
<
[email protected]
>
Tue, 20 Sep 2016 16:12:45 +0000
(18:12 +0200)
committer
Arnaldo Carvalho de Melo
<
[email protected]
>
Tue, 20 Sep 2016 19:20:21 +0000
(16:20 -0300)
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 <
[email protected]
>
Cc: Andi Kleen <
[email protected]
>
Cc: David Ahern <
[email protected]
>
Cc: Don Zickus <
[email protected]
>
Cc: Joe Mario <
[email protected]
>
Cc: Namhyung Kim <
[email protected]
>
Cc: Peter Zijlstra <
[email protected]
>
Link:
http://lkml.kernel.org/r/20160920161245.GA8995@krava
Signed-off-by: Arnaldo Carvalho de Melo <
[email protected]
>
tools/perf/util/dso.c
patch
|
blob
|
history
diff --git
a/tools/perf/util/dso.c
b/tools/perf/util/dso.c
index 774f6ec884d50cf0d2d3696689e0ca8c4e8e27c5..d2c6cdd9d42b72a194d913bdc1840d5ff72bb281 100644
(file)
--- 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;