Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp794531rwb; Mon, 26 Sep 2022 06:04:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6dQKJrzAQjL4Fx0L+8f3pU+DEgE8qE8vp/4ZGmzQaE4qOltDPCrlY/HGkqWSNmKMOwluKk X-Received: by 2002:a65:694b:0:b0:43b:f03d:32b0 with SMTP id w11-20020a65694b000000b0043bf03d32b0mr18990065pgq.543.1664197457367; Mon, 26 Sep 2022 06:04:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664197457; cv=none; d=google.com; s=arc-20160816; b=t0CZ7Bcr352/GT6VmK1uKYDGBSpi1H/+N1JVyxCr9ESTmKJ1PR0xMZCo46rWErjISC WXB1mBg1KHw43Bpn8+xyn4Dki4Om4fowI7MpvQqBriF81kgpIHKgCBllKeM+xdVcIaQF Ma81KP4YKJHe8PpKja7CH+nBsMi6F0SWCVe379hjQHSMSl+EDRObvKW1v3R8njG0ypsx X4ldTiRQyfMifv78zxKGAWL+naPBGk2/P4kiVTgxdBRLX6Jgx+Wz2qx83JNLrC8G8SPe Ym/Ywl91JC3e1mTeaqXuQ6mgxYW7JerQ2pPdtjcPKViitAkurzPPnLIfSLmaHuGV/MXQ XGew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PffWHIP8qTPglSqvevonIkhYtElDuVNA2QOTEdE5vuA=; b=mQG8uJXlWV+w/Ab8y1AE+ODm3mRU9s+JfC27s6wJiValLcFnC+bL8cgLTULXD4GA9P d53ojMEqvPT+xEZ6jKvsMBEWr/wt4AuXiqPixQpOzFE/fCqfeJ9Yp49Ou/rDdhwnal/M M/Ezunq+GBbbJ0PFq+xLcbCSvwEjpTCbSWRp9IVtYSVcdpAIS1xlw0sNV3NYVdfZ7jAn VTgXxGZfpsGBw/aHKhFacJBt5cqxfKkzxHnW/WLoItu0ZAyGhvLaqttFqTU5R9OKDNFh zAUN76AnUugwkWNG8eDlMXBjz3lc5VbRFZgLjuFp9Yw1upSwtGjKBFHtByunTtuzOtF9 Y2UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XUkbKAWW; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e24-20020a63ee18000000b0043c24d2c0dasi12914801pgi.141.2022.09.26.06.04.04; Mon, 26 Sep 2022 06:04:17 -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=@linuxfoundation.org header.s=korg header.b=XUkbKAWW; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236447AbiIZKpo (ORCPT + 99 others); Mon, 26 Sep 2022 06:45:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233804AbiIZKna (ORCPT ); Mon, 26 Sep 2022 06:43:30 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 744E61CB; Mon, 26 Sep 2022 03:24:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 57B72CE10E7; Mon, 26 Sep 2022 10:24:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4545EC433D6; Mon, 26 Sep 2022 10:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187869; bh=zadlpnKD6sjdhTaeTlpUHuA+J3MSs8/PSaLg59JCzQo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XUkbKAWWp7L8GzZZV08rr5xAiJaRc7vlfXqnlmDxx53edJD9rksSsTKgA8iQNSEYJ hta/I7yljzIvHb21hVXzfc5eZHVymJqUknJ+DWJT4VdGo9YHcC371+UCzPAaJBNlom 4ALfEznMyClDfsXwn7ieXtjgndWGPKHjcff1ESBs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Dao , Adrian Hunter , Namhyung Kim , Ian Rogers , Jiri Olsa , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.4 087/120] perf kcore_copy: Do not check /proc/modules is unchanged Date: Mon, 26 Sep 2022 12:12:00 +0200 Message-Id: <20220926100754.217398729@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100750.519221159@linuxfoundation.org> References: <20220926100750.519221159@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 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 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 From: Adrian Hunter [ Upstream commit 5b427df27b94aec1312cace48a746782a0925c53 ] /proc/kallsyms and /proc/modules are compared before and after the copy in order to ensure no changes during the copy. However /proc/modules also might change due to reference counts changing even though that does not make any difference. Any modules loaded or unloaded should be visible in changes to kallsyms, so it is not necessary to check /proc/modules also anyway. Remove the comparison checking that /proc/modules is unchanged. Fixes: fc1b691d7651d949 ("perf buildid-cache: Add ability to add kcore to the cache") Reported-by: Daniel Dao Signed-off-by: Adrian Hunter Tested-by: Daniel Dao Acked-by: Namhyung Kim Cc: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220914122429.8770-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/symbol-elf.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index a04a7dfb8ec0..f15258fbe9db 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -1912,8 +1912,8 @@ static int kcore_copy__compare_file(const char *from_dir, const char *to_dir, * unusual. One significant peculiarity is that the mapping (start -> pgoff) * is not the same for the kernel map and the modules map. That happens because * the data is copied adjacently whereas the original kcore has gaps. Finally, - * kallsyms and modules files are compared with their copies to check that - * modules have not been loaded or unloaded while the copies were taking place. + * kallsyms file is compared with its copy to check that modules have not been + * loaded or unloaded while the copies were taking place. * * Return: %0 on success, %-1 on failure. */ @@ -1976,9 +1976,6 @@ int kcore_copy(const char *from_dir, const char *to_dir) goto out_extract_close; } - if (kcore_copy__compare_file(from_dir, to_dir, "modules")) - goto out_extract_close; - if (kcore_copy__compare_file(from_dir, to_dir, "kallsyms")) goto out_extract_close; -- 2.35.1