Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5409826rwb; Tue, 1 Aug 2023 01:57:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlHh1G1xkq2LuC1UmqD6T26RZbaSvGw1k5SSt2shV3G64w8qBzMXehF+QOvB5IRjYtzv5bOp X-Received: by 2002:a17:902:d507:b0:1b6:c229:c350 with SMTP id b7-20020a170902d50700b001b6c229c350mr14554854plg.18.1690880250891; Tue, 01 Aug 2023 01:57:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690880250; cv=none; d=google.com; s=arc-20160816; b=LZy8UwraADaPM+24hHflFUywCFSo65RB8LK197kVFLRJiMZt0HqYOeKu/2oJ50piOi 2FyKZFyumBR+Gz8cZkgcv3eV5NwBSCRSr4R5G+Rrr0xJsJZVcL+83jS7BcfGXdyfrQs8 zaa2IUvWx06JJG7Qm8otiN81hYi4qjQpz32qycZGxNF1R7KCMoJAJHILW5ZgNZmSg6CJ vcRU6mlmK3vhkMNV1fgRw8xavVu+XX/ASIdjZEQckvA6cpdo4VkTBjEpjniaoOUMaRHm 7/ipIE0dOP1dZZDqpwuTa3RGfk/x0nCHQ83iL5A2rbQCCW2inaTEyrnO+xySjkr9/7kg u0vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=lnMES24EBiQx3qcbFFtigb0MbD+oo8BpDrTAYwD8j/E=; fh=gYkZn1sK04uMThczCys6E2QnV17Ujn5A7Cwm9vvcTJM=; b=TBA22sUs3sZ+Ses2DzhE+oi9qdRT4vBQU6AfRATGJPg88ykWWJ1hZ+iuqe/wp0ihqx fNWIcp+EMj91a8OT0UNLnFUUgO6WhrySW4VdjkY3LKcSOCt1h4IwxV2ILR8pM0hS+Dj6 1h1mYzflG4ud0JnRzBZWzgNmnCJYKruoIGGx9upAy9STtnn5z5RHRsETmyNWgc7eEZ6s sYCJBNbLVQ7KHK89Z9/11ZLsix4Zl7Ewk9nz9lqtBgjRid3N0EsrO0keAtiT+3xw0yoC abOnom2yMm54bwgwrm1VSjOO3ZlXRSvpKXRShWFlFp7E2oIxCtB1HdCNhY4N/jhFOUsl HBmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FZv0LIEb; 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 a6-20020a170902ecc600b001bbfdb016a5si5146724plh.185.2023.08.01.01.57.19; Tue, 01 Aug 2023 01:57:30 -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=FZv0LIEb; 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 S231710AbjHAI1m (ORCPT + 99 others); Tue, 1 Aug 2023 04:27:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230086AbjHAI1k (ORCPT ); Tue, 1 Aug 2023 04:27:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAB7F18D; Tue, 1 Aug 2023 01:27:39 -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 70D67614B7; Tue, 1 Aug 2023 08:27:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18D49C433C8; Tue, 1 Aug 2023 08:27:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690878458; bh=KzvQJSYl9zliORTATgBPPvvWaET21XrF4cyjVIv9/XI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FZv0LIEbh+eOtxTtda3mi1G/HakIbe4Ec/6Cnmn9LUdCI9FrOiksmCTzlNNxzlBT4 MIXgNCSE3fyG7gBR5M5LOaV2UqtKnz2wytJDF/fHQqQV/hNxSLBaWToD6oTaw1NMRd +SIbBEMPRFEKmu2jycm5AbpsPeS4ZHVtztmmGOXbgoPPsZ80Dgj7wWuwDRLsUK0Z4l lFcVJoEbOn89u6D2oojaW5lWSBCHM+w3WZkqKSPCPB7Dl4f5cJ6OqhZ+35nM4vJ78G vP5U4ShZUHWBxh+G6+anK9+8wSAY23SydlfQLmHlgbScPb2Uawy59U4JhVgpda0KI/ 7+X51JArLXGog== Date: Tue, 1 Aug 2023 09:27:31 +0100 From: Will Deacon To: Lorenzo Stoakes Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Baoquan He , Uladzislau Rezki , linux-fsdevel@vger.kernel.org, Jiri Olsa , Mike Galbraith , Mark Rutland , wangkefeng.wang@huawei.com, catalin.marinas@arm.com, ardb@kernel.org, David Hildenbrand , Linux regression tracking , regressions@lists.linux.dev, Matthew Wilcox , Liu Shixin , Jens Axboe , Alexander Viro , stable@vger.kernel.org Subject: Re: [PATCH] fs/proc/kcore: reinstate bounce buffer for KCORE_TEXT regions Message-ID: <20230801082729.GA26036@willie-the-truck> References: <20230731215021.70911-1-lstoakes@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230731215021.70911-1-lstoakes@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 On Mon, Jul 31, 2023 at 10:50:21PM +0100, Lorenzo Stoakes wrote: > Some architectures do not populate the entire range categorised by > KCORE_TEXT, so we must ensure that the kernel address we read from is > valid. > > Unfortunately there is no solution currently available to do so with a > purely iterator solution so reinstate the bounce buffer in this instance so > we can use copy_from_kernel_nofault() in order to avoid page faults when > regions are unmapped. > > This change partly reverts commit 2e1c0170771e ("fs/proc/kcore: avoid > bounce buffer for ktext data"), reinstating the bounce buffer, but adapts > the code to continue to use an iterator. > > Fixes: 2e1c0170771e ("fs/proc/kcore: avoid bounce buffer for ktext data") > Reported-by: Jiri Olsa > Closes: https://lore.kernel.org/all/ZHc2fm+9daF6cgCE@krava > Cc: stable@vger.kernel.org > Signed-off-by: Lorenzo Stoakes > --- > fs/proc/kcore.c | 26 +++++++++++++++++++++++++- > 1 file changed, 25 insertions(+), 1 deletion(-) Tested-by: Will Deacon I can confirm this fixes the arm64 issue reported by Mike over at [1]. Cheers, Will [1] https://lore.kernel.org/r/b39c62d29a431b023e98959578ba87e96af0e030.camel@gmx.de