From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03896C25B50 for ; Fri, 20 Jan 2023 19:56:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230152AbjATT4v (ORCPT ); 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: Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CFE0BC05027 for ; Fri, 20 Jan 2023 19:57:02 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pIxVV-0005y6-O1; Fri, 20 Jan 2023 19:57:01 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pIxVU-0005xm-DZ for linux-f2fs-devel@lists.sourceforge.net; Fri, 20 Jan 2023 19:56:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=KpHlBb97LQTcshbNZtdvlSFh72rBjv78NA5cF2ZoIsc=; b=Iaa7x3RG/vBkJgixDZ7hVXq5qy 6gvc66XgXFHZjeBFRMeqZlkSZzKEr5qz7UOK1+cHVDPEZjAdYJ1ZnXcc51izg9I91VOkLHUi76WIA EkqJ1+Zk/2dQ8K7+tugnHFXMw3JUtyyanmztzXb2OviaF3hzU+kQq206y2wYqN7z5Ml4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=KpHlBb97LQTcshbNZtdvlSFh72rBjv78NA5cF2ZoIsc=; b=MXq7kPDeV5YsQk85AcWB1o0iAK GrSXe1mbXf+RQgJ1lU3HjvjUHMNTcdG1G0R6QXotya4GqJZdayDVL2as1n/MJ5TtVxQCY7FbXN+5t YEvGuRH5VvkFYSjblsLDgDddxffziZyyH1sA8ymVr5UDzvkOfekjDzinTTdb84fQA85A=; Received: from ams.source.kernel.org ([145.40.68.75]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pIxVP-00060N-Dh for linux-f2fs-devel@lists.sourceforge.net; Fri, 20 Jan 2023 19:56:59 +0000 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 53352B82940; 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 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-Disposition: inline In-Reply-To: X-Headers-End: 1pIxVP-00060N-Dh Subject: Re: [f2fs-dev] [PATCH v2 10/11] fs/buffer.c: support fsverity in block_read_full_folio() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel