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 X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46C78C433DF for ; Thu, 8 Oct 2020 17:05:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EAE9E221FE for ; Thu, 8 Oct 2020 17:05:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602176755; bh=BcdaZq8ar4XX+2VOyCYshYDAMVSvt+n6/c1IW4iUOfM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=gT6JTRTnDQAC5GmcyTjk1dxxBlr2dT1SnNwAQ2GQvAqUgFpVLqEUfxAC1d9z9Sr4o Yy91h/hebzINNKwB4ANdC7BgvCGE1obSXfy6lRAOfwwBCGGh7Wl7qg3kLMlXO/Gs5e Mq/mGC5MvcBNbqQb+CVvHQPzBQa2lK5UULXJ2m80= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731552AbgJHRFy (ORCPT ); Thu, 8 Oct 2020 13:05:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:34552 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730442AbgJHRFy (ORCPT ); Thu, 8 Oct 2020 13:05:54 -0400 Received: from gmail.com (unknown [104.132.1.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5F42921D7D; Thu, 8 Oct 2020 17:05:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602176753; bh=BcdaZq8ar4XX+2VOyCYshYDAMVSvt+n6/c1IW4iUOfM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uAUcdYaozNytHFrBAl5SWYRuaP3ehrQ6a0xozh1La36HyBZjhclNRckdMr6HiV089 pGp2BspU/uQTRZp4q1hL2s5YLQOgAezBVIQF2thcthMr8rmSUjU2COAtDCFt5NyjCQ KISB4BRgdtIWZEEo2y/XhRJBaQVViqg8cW79ABr0= Date: Thu, 8 Oct 2020 10:05:51 -0700 From: Eric Biggers To: Satya Tangirala Cc: "Theodore Y . Ts'o" , Jaegeuk Kim , Chao Yu , linux-kernel@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [PATCH 2/3] fscrypt: Add metadata encryption support Message-ID: <20201008170551.GB1869638@gmail.com> References: <20201005073606.1949772-1-satyat@google.com> <20201005073606.1949772-3-satyat@google.com> <20201007205221.GA1530638@gmail.com> <20201007232806.GB2544297@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201007232806.GB2544297@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org On Wed, Oct 07, 2020 at 11:28:06PM +0000, Satya Tangirala wrote: > > This needs Kconfig help text to describe what this feature is and why anyone > > would want to enable it. It also needs an update to > > Documentation/filesystems/fscrypt.rst, and a test in xfstests that tests that > > the encryption is being done correctly. > > > Sure. I forgot to mention, fwiw I did hack xfstests to enable metadata > encryption on each device to try to test the code, and also some other > informal tests, but as you point out, I should send out actual xfstests > to test this. To be clear, I'm asking for tests which verify the actual ciphertext written to disk. So similar to _verify_ciphertext_for_encryption_policy() in xfstests, or to vts_kernel_encryption_test in Android's VTS. > > Perhaps fscrypt_set_bio_crypt_ctx() should call this? It seems there should be > > a single function that filesystems can call that handles setting the > > bio_crypt_ctx for both file contents and metadata encryption. > > > I mistakenly dismissed this idea when I was coding this up :( - I'll do > this for the next version... I think it'll also make supporting direct I/O > easier in future :) . Also, I might require FS_ENCRYPTION_INLINE_CRYPT > when enabling FS_ENCRYPTION_METADATA to maybe make the code slightly > cleaner (unless there's a reason we want to support metadata encryption > without FS inline encryption being enabled?). Since metadata encryption would already depend on FS_ENCRYPTION and BLK_INLINE_ENCRYPTION, I think it would be fine to require FS_ENCRYPTION_INLINE_CRYPT too, in order to reduce the number of combinations. - 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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FF22C433DF for ; Thu, 8 Oct 2020 17:06:23 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B5A1021D7D for ; Thu, 8 Oct 2020 17:06:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="N7b3Z2kZ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="AQOqawdQ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="uAUcdYao" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B5A1021D7D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net 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.90_1) (envelope-from ) id 1kQZMz-0004Qd-73; Thu, 08 Oct 2020 17:06:21 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQZMx-0004QW-Cc for linux-f2fs-devel@lists.sourceforge.net; Thu, 08 Oct 2020 17:06:19 +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=0Q3Mm3gJVzGfrhz3Y+FQl16YOlJ3CQXn3ykzNiXZI7w=; b=N7b3Z2kZGwOMe7J3ulhNEjv8mL 43DrMbfBHsU6jdbZfcNz4xgDe3eINBNdM2dzdbZmWncFl6uIqYaGitK1v/HZQwdv/2oVHOqEuVEmo kYz440yW5uNWiD6m+T014AqRSd4Mee6mktJXBj4muzyJjCbVrWn65FNKEhA2T5GhXBOg=; 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=0Q3Mm3gJVzGfrhz3Y+FQl16YOlJ3CQXn3ykzNiXZI7w=; b=AQOqawdQwWd6sYQMao+/w+k4lr D8RfhKMqx+yGGIgJYSSCDDG6oeHTuKp2Xy/yPTGPS55gMdmy1N+S6Q2gGLVSud6SGhJLqPKkaIf5V uRWgt5ggcjSo+WusJOFL3/7wGn/i5m3qGspvwrINMksl0SyCl3zJMWDi5k/Hv0Zg/nAs=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1kQZMk-003Ivl-KQ for linux-f2fs-devel@lists.sourceforge.net; Thu, 08 Oct 2020 17:06:19 +0000 Received: from gmail.com (unknown [104.132.1.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5F42921D7D; Thu, 8 Oct 2020 17:05:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602176753; bh=BcdaZq8ar4XX+2VOyCYshYDAMVSvt+n6/c1IW4iUOfM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uAUcdYaozNytHFrBAl5SWYRuaP3ehrQ6a0xozh1La36HyBZjhclNRckdMr6HiV089 pGp2BspU/uQTRZp4q1hL2s5YLQOgAezBVIQF2thcthMr8rmSUjU2COAtDCFt5NyjCQ KISB4BRgdtIWZEEo2y/XhRJBaQVViqg8cW79ABr0= Date: Thu, 8 Oct 2020 10:05:51 -0700 From: Eric Biggers To: Satya Tangirala Message-ID: <20201008170551.GB1869638@gmail.com> References: <20201005073606.1949772-1-satyat@google.com> <20201005073606.1949772-3-satyat@google.com> <20201007205221.GA1530638@gmail.com> <20201007232806.GB2544297@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201007232806.GB2544297@google.com> X-Headers-End: 1kQZMk-003Ivl-KQ Subject: Re: [f2fs-dev] [PATCH 2/3] fscrypt: Add metadata encryption support 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: "Theodore Y . Ts'o" , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fscrypt@vger.kernel.org, Jaegeuk Kim Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Wed, Oct 07, 2020 at 11:28:06PM +0000, Satya Tangirala wrote: > > This needs Kconfig help text to describe what this feature is and why anyone > > would want to enable it. It also needs an update to > > Documentation/filesystems/fscrypt.rst, and a test in xfstests that tests that > > the encryption is being done correctly. > > > Sure. I forgot to mention, fwiw I did hack xfstests to enable metadata > encryption on each device to try to test the code, and also some other > informal tests, but as you point out, I should send out actual xfstests > to test this. To be clear, I'm asking for tests which verify the actual ciphertext written to disk. So similar to _verify_ciphertext_for_encryption_policy() in xfstests, or to vts_kernel_encryption_test in Android's VTS. > > Perhaps fscrypt_set_bio_crypt_ctx() should call this? It seems there should be > > a single function that filesystems can call that handles setting the > > bio_crypt_ctx for both file contents and metadata encryption. > > > I mistakenly dismissed this idea when I was coding this up :( - I'll do > this for the next version... I think it'll also make supporting direct I/O > easier in future :) . Also, I might require FS_ENCRYPTION_INLINE_CRYPT > when enabling FS_ENCRYPTION_METADATA to maybe make the code slightly > cleaner (unless there's a reason we want to support metadata encryption > without FS inline encryption being enabled?). Since metadata encryption would already depend on FS_ENCRYPTION and BLK_INLINE_ENCRYPTION, I think it would be fine to require FS_ENCRYPTION_INLINE_CRYPT too, in order to reduce the number of combinations. - Eric _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel