Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3653805rwo; Mon, 24 Jul 2023 14:38:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlFStlVVKUdep/oZU36GtzNPC16YP56TRT7W9aTR8YNFnd0yvBjD6BZkicpP/WxhfahiRxan X-Received: by 2002:a17:906:73d3:b0:99b:4bab:2844 with SMTP id n19-20020a17090673d300b0099b4bab2844mr11366870ejl.55.1690234692943; Mon, 24 Jul 2023 14:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690234692; cv=none; d=google.com; s=arc-20160816; b=BBSrSgwuekuGgyW0lk1XoJvbpsVueOwU4Ka5mOCqm+EI9qcuQf0pb5ltQfvMjPZucj 33i2jpo+CVc2gQg6iEtaPnQdYeu9c4fa8gywaqx3B56NqTC9Bb91pvtb3eJmnGWXoFdy Ul01LRGsIYG511aO3u8N6qT6Iq9UZL77wNAmmIisj8JzO5WIw1643VCxHr6r6cDdS+NR tA+c984h2QsbkhJYD8mrOpXfDZEBDxXXJmFKZNBotf3DLE3doRqVpOqrQ5BVJ0Dunw62 tbfekaaGrAn7PMxK47ZtEob9hqMg7pN61kNr4EV4PIbL91pCGuaSgMLYBKhj7hePgi9z asmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=ecWkKDRIhtBSRO/ocXmTyxgvdc4G7bXvRsEJOT9lwII=; fh=ume6SLGMq0zW9duCxY8mlVqU+NEoaKhQvIUvmebpXpc=; b=iC3hCWEkE+YVeH6oRvLDPZI73Y88bJxJrUiZodC/keD5NVytAz3zUcJaXQIvCAIoqf Pqf3NQpbrzI6JPy6neO0IAkJ0R0+e2VnzipLFnv+Yf7tvm3XCksznxAzIdhe9duDCFwT HBsrmL7rEnIZz7gWmNDG+mlM4wYIwhs5C3884cQqpSYpOmZZ4kvC772rE0BiRzNPZjyL lD+WbHfeBdpPl8mspHW8BCjcHhRGi0Va15SoSrYskeRkmcnZ19KmoPVqEBV3AnGs9Jcc A9Q1Ro2vCktITf4GUQ5aoS2W9dQStkHyRC2Lj/U5FMcak+tYuuMqtATs736ytkuq1dok bujA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lB3gRgm7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a170906068b00b00992b8854f48si7320405ejb.556.2023.07.24.14.37.48; Mon, 24 Jul 2023 14:38:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lB3gRgm7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229735AbjGXVJL (ORCPT + 99 others); Mon, 24 Jul 2023 17:09:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbjGXVJK (ORCPT ); Mon, 24 Jul 2023 17:09:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE04E1BC for ; Mon, 24 Jul 2023 14:09:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8743961263 for ; Mon, 24 Jul 2023 21:09:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 898A0C433C8; Mon, 24 Jul 2023 21:09:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690232947; bh=AxIobRBY2/FxVQu3cP3nLe9fjgkFu7v5YoBCsJlOszA=; h=Date:From:To:Cc:Subject:From; b=lB3gRgm7k6xhfX0uIm09ccs+nQ1AtwJpE5kTUsJ6XdDBhD/h5y+Ij/aSdKb3Ca98Z HUa1JfJj3JRmG92ARdqtfiyAe4sXl38KfcmaGmgEono4jbUCxnbqidG3Z7JiMD5JN8 QbsVOmHlgY/ZR8QjWpl0evV0A8Z+tVdZMUrdI5ixD7t/pF/KZePdrF3LtOTX+8EN0W qtdvyEaRgS4JPpTxx1HagP4g53+RguYhwfkl+3xgCzCsA4sVnTL1xJYghg5+uvHbeK 8tplp6dqxc/1LbLCGg4CvnwdFZQcmspG/BUjRbZ7yDwwOUt/1L+BWLn+lv6fxKwGpb kG04dLc142h3w== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id B203140516; Mon, 24 Jul 2023 18:09:04 -0300 (-03) Date: Mon, 24 Jul 2023 18:09:04 -0300 From: Arnaldo Carvalho de Melo To: Adrian Hunter Cc: "Aneesh Kumar K.V" , Athira Rajeev , Disha Goel , Ian Rogers , Jiri Olsa , Kajol Jain , Madhavan Srinivasan , Namhyung Kim , Linux Kernel Mailing List Subject: [PATCH 1/1] perf dlfilter: Initialize addr_location before passing it to thread__find_symbol_fb() Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As thread__find_symbol_fb() will end up calling thread__find_map() and it in turn will call these on uninitialized memory: maps__zput(al->maps); map__zput(al->map); thread__zput(al->thread); Fixes: 0dd5041c9a0eaf8c ("perf addr_location: Add init/exit/copy functions") Cc: Adrian Hunter Cc: Aneesh Kumar K.V Cc: Athira Rajeev Cc: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: Kajol Jain Cc: Madhavan Srinivasan Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/ Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/dlfilter.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/dlfilter.c b/tools/perf/util/dlfilter.c index 46f74b2344dbb34c..798a53d7e6c9dfc5 100644 --- a/tools/perf/util/dlfilter.c +++ b/tools/perf/util/dlfilter.c @@ -166,6 +166,7 @@ static __s32 dlfilter__resolve_address(void *ctx, __u64 address, struct perf_dlf if (!thread) return -1; + addr_location__init(&al); thread__find_symbol_fb(thread, d->sample->cpumode, address, &al); al_to_d_al(&al, &d_al); -- 2.37.1