Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1441642pxu; Thu, 8 Oct 2020 11:32:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZusHLKJZr//R/TV142/ACQertE1RfKZl9VxkUFdaauVuTb+b/vtC7uUQrdgTt6ct378Q+ X-Received: by 2002:a17:906:698d:: with SMTP id i13mr9721043ejr.229.1602181924176; Thu, 08 Oct 2020 11:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602181924; cv=none; d=google.com; s=arc-20160816; b=rVNS8zkneZBe3rxxsJrQlhrFe9fWvIBC1OxagyKv0gi8W7zNHtSytepHJVAcibFiiB F2mUJQjGQD/BGR3l59d630xhWSxnLdu9NHqdckCa6r+R3+XHpz9VpuGUapft0a+wIf3+ aZVs2SeO4ZKPDmX61K8P551uc4efBN4eXlewCYlOXYd8npfLMm9oJGx2zD25NbUQE/P5 5Mb4P5lHHPhuWj1YYB6iJLAvOikjZ73S5XUeBeHV/3UUa2uyM0qVnK+Ayzvvb8huTXJ/ 7DSWqZBxkc5jyNtj6Mq+zzVSyKGp2j+vA5b4E8GL+xQF0rBeb+M4fuVdqpEBba8VIKuN oKoQ== 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=0Q3Mm3gJVzGfrhz3Y+FQl16YOlJ3CQXn3ykzNiXZI7w=; b=vso+G8M32XAQbgPmRa95QZAJFGrem33/sI+NukqhZxRMAEJn2Fjk6uf5nchMMU9iWF gjWcuczJisKeBkRlJ5g8/K5t1XIKYCpubwV4L52q6HFpwj3QooEKiOD2BYXA76QkZXQN ayYbxRbgGDdkMw36Lu7qvXnOA4PHLejcN0be08GevcoQNn3sDjnup9n3vmD0CnsU25zr 4zRj1rjlezcs03R3BQR7EmeAPM5X7yjcavrQy7m72TwnJJBc+JKXTpwjE+JaPLwnHoTP MYsRi8aHBRNCBzKSTUwBaqc7HKK7UzYx6QIVGGsW3duVNsKOKJhdsP73kVyxn5a9f6Uy o4Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uAUcdYao; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l2si4366634ejb.423.2020.10.08.11.31.40; Thu, 08 Oct 2020 11:32:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uAUcdYao; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1731557AbgJHRFy (ORCPT + 99 others); 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-kernel@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