[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160920161245.GA8995@krava>
Date: Tue, 20 Sep 2016 18:12:45 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Jiri Olsa <jolsa@...nel.org>, lkml <linux-kernel@...r.kernel.org>,
Don Zickus <dzickus@...hat.com>, Joe Mario <jmario@...hat.com>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Namhyung Kim <namhyung@...nel.org>,
David Ahern <dsahern@...il.com>,
Andi Kleen <andi@...stfloor.org>
Subject: [PATCHv2 01/61] perf symbols: Do not open device files
On Tue, Sep 20, 2016 at 05:36:47PM +0200, Jiri Olsa wrote:
> On Tue, Sep 20, 2016 at 12:28:03PM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Mon, Sep 19, 2016 at 03:09:10PM +0200, Jiri Olsa escreveu:
> > > Moving the regular file check into the entry
> > > of the dso__read_binary_type_filename function.
> > >
> > > This way we can eliminate some calls and extend
> > > the file check for all cases.
> >
> > Bzzt:
> >
> > [root@...et ~]# perf test "Test dso"
> > 8: Test dso data read : FAILED!
> > 9: Test dso data cache : FAILED!
> > 10: Test dso data reopen : FAILED!
> > [root@...et ~]#
>
> ugh, will check.. thanks
ook, I confused this one with earlier version, sry.. correct version attached
it's pushed in the perf/c2c branch now
thanks,
jirka
---
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.
Link: http://lkml.kernel.org/n/tip-twbp391v8v9f5idp584hlfov@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
---
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 774f6ec884d5..d2c6cdd9d42b 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;
--
2.7.4
Powered by blists - more mailing lists