From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751607AbcGUHzE (ORCPT ); Thu, 21 Jul 2016 03:55:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41412 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751126AbcGUHzB (ORCPT ); Thu, 21 Jul 2016 03:55:01 -0400 Date: Thu, 21 Jul 2016 09:54:58 +0200 From: Jiri Olsa To: Marc Kleine-Budde Cc: Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, Jiri Olsa , Uwe Kleine-Koenig Subject: Re: [PATCH] perf: symbols: dso__load(): remove check of file on uninitialized memory Message-ID: <20160721075458.GB7651@krava> References: <1466691621-29488-1-git-send-email-mkl@pengutronix.de> <20160624064345.GB32753@krava> <0d026547-6805-fe34-3430-67ae979eed57@pengutronix.de> <20160624115112.GD10142@krava> <2ca568c2-e6b7-fb0d-48bb-80aa3daefc98@pengutronix.de> <2064e6de-8535-d06a-4f0d-010377a42f5a@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2064e6de-8535-d06a-4f0d-010377a42f5a@pengutronix.de> User-Agent: Mutt/1.6.2 (2016-07-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 21 Jul 2016 07:55:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 21, 2016 at 09:21:00AM +0200, Marc Kleine-Budde wrote: SNIP > >>>>> This patch fixes the problem by removing the check. > >>>>> > >>>>> Fixes: 403567217d3f perf symbols: Do not read symbols/data from device files > >>>>> Signed-off-by: Marc Kleine-Budde > >>>>> --- > >>>>> tools/perf/util/symbol.c | 3 +-- > >>>>> 1 file changed, 1 insertion(+), 2 deletions(-) > >>>>> > >>>>> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c > >>>>> index 8a747dc6cf86..b4070daeb17f 100644 > >>>>> --- a/tools/perf/util/symbol.c > >>>>> +++ b/tools/perf/util/symbol.c > >>>>> @@ -1432,8 +1432,7 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter) > >>>>> * Read the build id if possible. This is required for > >>>>> * DSO_BINARY_TYPE__BUILDID_DEBUGINFO to work > >>>>> */ > >>>>> - if (is_regular_file(name) && > >>>>> - filename__read_build_id(dso->long_name, build_id, BUILD_ID_SIZE) > 0) > >>>>> + if (filename__read_build_id(dso->long_name, build_id, BUILD_ID_SIZE) > 0) > >>>>> dso__set_build_id(dso, build_id); > >>>> > >>>> ouch copy&paste error.. we better fix it properly, > >>>> could you please check attached patch? > >>> > >>> The use of uninitialized memory is gone, but the "--symfs" option is > >>> ignored: > >>> > >>>> stat("/lib/libpthread-2.20.so", 0x7ffe440c1270) = -1 ENOENT (No such file or directory) > >>> > >>> You'll look for the dso in the root file system not in the sysroot. > >> > >> that seems like unrelated to the 'use of uninitialized memory' issue, right? > >> I can't see how the patch I sent could do that.. > > > > Right. That's a different issue. You can add my: > > > > Acked-by: Marc Kleine-Budde > > I don't see this patch on mainline nor on linux-next, or am I missing > something? sorry for delay, forgot about this one... I asked Arnaldo to take this version instead: http://marc.info/?l=linux-kernel&m=146908497508581&w=2 thanks, jirka