Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3166371rwb; Fri, 20 Jan 2023 12:08:30 -0800 (PST) X-Google-Smtp-Source: AMrXdXs8bQb7e/JvSUuKaOQ5mt5e/X01u44MZG3JKekUHxneX66SCpGpjNLmQ+LDKjAi7Yq5QNnI X-Received: by 2002:a17:907:3e26:b0:870:b53e:86b9 with SMTP id hp38-20020a1709073e2600b00870b53e86b9mr16429446ejc.39.1674245309850; Fri, 20 Jan 2023 12:08:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674245309; cv=none; d=google.com; s=arc-20160816; b=K+zVYhxu/NOxw2HeeYC+ggbT8qOO0Ew3cOfKU0qnqU//QL0nS9yfe5cmzK0tIYGXTP J0PpSkcHCrYlyHRpHbvX6S2wDZpFkPiW5BKRqe/aVnwhAICfu8simC2W95uk8Wd64AmA Q2CUPrcvq89zyWtQDHZTI5SMf5ZDJHHRAGjxUVxiiJAGW/nUI6uRZIoj1CN6D+x2BAHr fbzsVRcCJLELQRnX320ONcVnYTZ58h84kZ66FjKg10ADjHjniuqtOqWeOZJ/jakkcrbF bu17subF/sUslZ2hHTirSncYFzOtOaJ/AxRqRvOLB+exy3vzpGzLllx29GA4bGHhOpNf GEbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KpHlBb97LQTcshbNZtdvlSFh72rBjv78NA5cF2ZoIsc=; b=LA80+6BarRqyVrOLlQvKo8J42shUtrJAKb75xkMZsMucgYyc1Gv/qBUhp4uSlyIHka E7dRL7nRdPgehiz9UDYbJ1INU56q3+KBOSN75tjtkjYb7DE/diepGzuSIDe4HAEdHZvo F4BKuGt/w2rFmlU0cLMWaQ1684emF5tfnvnLV10tn41ODbV/VfmFUqIz/7FOcbUA3Nzf 4YxxhIHAnTupNn+yZv3XzFUUYbSbocStnexdRmvbjj6Vp2dXy/rJbX4KvXfvzZddDWQ+ MvmfRUQYQ9mzKdhJ1ncmlauqjJnDmAODQwnbD8DVGsEfiYLl/glMeh/C91+znl4jQRX+ xDOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hyrxu8zg; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 js18-20020a17090797d200b0086dd3de7985si24390842ejc.864.2023.01.20.12.08.00; Fri, 20 Jan 2023 12:08:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-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=hyrxu8zg; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 S230114AbjATT4v (ORCPT + 99 others); Fri, 20 Jan 2023 14:56:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230123AbjATT4u (ORCPT ); Fri, 20 Jan 2023 14:56:50 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA74CEF96; Fri, 20 Jan 2023 11:56:49 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 53A8DB82A53; Fri, 20 Jan 2023 19:56:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C168DC433D2; Fri, 20 Jan 2023 19:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674244607; bh=WgPwAk68Gp6i/8CNzDeljqUnskSbMUtSRKCUvjWRZ+8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hyrxu8zgAFjp28BCELZ5qHOWfx7QkHNrkTxMlvnuXWFb2SUtRSP1RKZooDLdabEI2 TEhfwoHJ5FBUIxZhyqMO4CHfD246TDXm0v+0rP8LutJU+E1iWmJ7DjknJ6MVLzCVCF PIGqU8sEBbr+KN8kLiHj9JlZzK+XkNMSUs28Oy+H1ZJGNrSNLSouYzBwJrPXTAFzBG AW7WpSDiR4BNsqOtIh0j+gKkYeYw4wmr7jPH5y9v1ax+gga0MWlSnJFDzgo36Vjm7t 6bMEFwVcgQZx+8qKhmCyCYYarw/7hc9xJSd6eZPBPq5Gj+UGZrXAlE1eEtfUlwRlE2 BH3xb/nru8sXg== Date: Fri, 20 Jan 2023 11:56:45 -0800 From: Eric Biggers To: Andrew Morton , linux-ext4@vger.kernel.org Cc: Andrey Albershteyn , linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org Subject: Re: [PATCH v2 10/11] fs/buffer.c: support fsverity in block_read_full_folio() Message-ID: References: <20221223203638.41293-1-ebiggers@kernel.org> <20221223203638.41293-11-ebiggers@kernel.org> <20230109183759.c1e469f5f2181e9988f10131@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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-ext4@vger.kernel.org On Mon, Jan 09, 2023 at 07:05:07PM -0800, Eric Biggers wrote: > On Mon, Jan 09, 2023 at 06:37:59PM -0800, Andrew Morton wrote: > > On Fri, 23 Dec 2022 12:36:37 -0800 Eric Biggers wrote: > > > > > After each filesystem block (as represented by a buffer_head) has been > > > read from disk by block_read_full_folio(), verify it if needed. The > > > verification is done on the fsverity_read_workqueue. Also allow reads > > > of verity metadata past i_size, as required by ext4. > > > > Sigh. Do we reeeeealy need to mess with buffer.c in this fashion? Did > > any other subsystems feel a need to do this? > > ext4 is currently the only filesystem that uses block_read_full_folio() and that > supports fsverity. However, since fsverity has a common infrastructure across > filesystems, in fs/verity/, it makes sense to support it in the other filesystem > infrastructure so that things aren't mutually exclusive for no reason. > > Note that this applies to fscrypt too, which block_read_full_folio() (previously > block_read_full_page()) already supports since v5.5. > > If you'd prefer that block_read_full_folio() be copied into ext4, then modified > to support fscrypt and fsverity, and then the fscrypt support removed from the > original copy, we could do that. That seems more like a workaround to avoid > modifying certain files than an actually better solution, but it could be done. > > > > > > This is needed to support fsverity on ext4 filesystems where the > > > filesystem block size is less than the page size. > > > > Does any real person actually do this? > > Yes, on systems with the page size larger than 4K, the ext4 filesystem block > size is often smaller than the page size. ext4 encryption (fscrypt) originally > had the same limitation, and Chandan Rajendra from IBM did significant work to > solve it a few years ago, with the changes landing in v5.5. > > - Eric Any more thoughts on this from Andrew, the ext4 maintainers, or anyone else? - Eric