From patchwork Mon Jul 24 21:09:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 125198 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2061557vqg; Mon, 24 Jul 2023 14:24:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlG2vp58OG0NHnc9PgKBTizoRB3sx3nmSR9tDje718m1s7eEnJTEiwYzLaJ+7oechNXaTWzP X-Received: by 2002:a05:6a21:3299:b0:130:d84b:eb91 with SMTP id yt25-20020a056a21329900b00130d84beb91mr11980977pzb.49.1690233843153; Mon, 24 Jul 2023 14:24:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690233843; cv=none; d=google.com; s=arc-20160816; b=WuGhbgC7eVE1e6Pc1k3JKAEVT9j4lzfd2eTH16cnBQbH7zU2p/bK02qsG5lKZsWHJG noQyFkNCLYS2af4wP/hDreYiSCQXU5mmTzbcaQD4u+wD1BKMhgRiQKUZvl4ZQLv6BOYl ZMinVnum6WpAVhxyytmzIxc6gKQUkHN+rZ/kdE/wNI7+ndQbf98prx0+PWu4y9h8rfPF ynE0QhDQ+cOQ0Q+fxUy9mz0BM9IT/83xSSPOD/yKuSMAJjIqGLahB2spA6Cct+LQE+DA +0DkVhqmGSdgfj/FqZVplezhSopdAeI1DOqDr5PNhL8A/KzZI1o+8d7edNkn9bdqQ/mz oT4A== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dc14-20020a056a0035ce00b00682c0908d51si9888942pfb.126.2023.07.24.14.23.50; Mon, 24 Jul 2023 14:24:03 -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 S229954AbjGXVJL (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-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772338641872449131 X-GMAIL-MSGID: 1772338641872449131 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);