From: Anand Jain <anand.jain@oracle.com>
To: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>,
linux-btrfs@vger.kernel.org, fstests@vger.kernel.org,
kernel-team@meta.com, ebiggers@google.com, fdmanana@suse.com,
linux-fscrypt@vger.kernel.org, fsverity@lists.linux.dev,
zlang@kernel.org
Subject: Re: [RFC PATCH v3 6/9] tests: adjust generic/429 for extent encryption
Date: Mon, 2 Oct 2023 19:20:40 +0800 [thread overview]
Message-ID: <a8634ac9-cadb-0aca-d079-6b6bac77935d@oracle.com> (raw)
In-Reply-To: <0952e60c8e73a41a0448e3ada8172744a6882550.1691530000.git.sweettea-kernel@dorminy.me>
On 09/08/2023 01:21, Sweet Tea Dorminy wrote:
> Extent encryption is different from the existing inode-based encryption
> insofar as it only generates encryption keys for data encryption at the
> moment at which the data is written. This means that when a session key is
> removed, even if there's an open file using it, that file immediately
> becomes unreadable and unwritable.
>
> This isn't an issue for non-session keys, which are soft deleted by
> fscrypt and stick around until there are no more open files with extent
> encryption using them. But for session keys, which are managed by the
> kernel keyring directly instead of through fscrypt, when they're removed
> they're removed.
>
> generic/429 uses session keys and expects to use the written data after
> key removal; while it's not quite what the test means for other
> filesystems, most of the test is still meaningful if we push the dirty
> data into the filesystem with a sync before dropping the key.
>
> Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
> ---
> tests/generic/429 | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tests/generic/429 b/tests/generic/429
> index 2cf12316..1d26deda 100755
> --- a/tests/generic/429
> +++ b/tests/generic/429
> @@ -68,6 +68,12 @@ show_directory_with_key()
> show_file_contents
> }
>
> +# btrfs needs to have dirty data pushed into it before session keyring
> +# is unlinked, as it doesn't set up the data encryption key until then.
A whitespace error in this line.
> +if [ "$FSTYP" = "btrfs" ]; then
> + sync
> +fi
> +
> # View the directory without the encryption key. The plaintext names shouldn't
> # exist, but 'cat' each to verify this, which also should create negative
> # dentries. The no-key names are unpredictable by design, but verify that the
next prev parent reply other threads:[~2023-10-02 11:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-08 17:21 [RFC PATCH v3 0/9] fstests: add btrfs encryption testing Sweet Tea Dorminy
2023-08-08 17:21 ` [RFC PATCH v3 1/9] common/encrypt: separate data and inode nonces Sweet Tea Dorminy
2023-08-08 17:21 ` [RFC PATCH v3 2/9] common/encrypt: add btrfs to get_encryption_*nonce Sweet Tea Dorminy
2023-10-02 11:22 ` Anand Jain
2023-08-08 17:21 ` [RFC PATCH v3 3/9] common/encrypt: add btrfs to get_ciphertext_filename Sweet Tea Dorminy
2023-08-08 17:21 ` [RFC PATCH v3 4/9] common/encrypt: enable making a encrypted btrfs filesystem Sweet Tea Dorminy
2023-08-08 17:21 ` [RFC PATCH v3 5/9] generic/613: write some actual data for btrfs Sweet Tea Dorminy
2023-08-08 17:21 ` [RFC PATCH v3 6/9] tests: adjust generic/429 for extent encryption Sweet Tea Dorminy
2023-10-02 11:20 ` Anand Jain [this message]
2023-08-08 17:21 ` [RFC PATCH v3 7/9] common/verity: explicitly don't allow btrfs encryption Sweet Tea Dorminy
2023-08-08 17:21 ` [RFC PATCH v3 8/9] btrfs: add simple test of reflink of encrypted data Sweet Tea Dorminy
2023-08-08 17:21 ` [RFC PATCH v3 9/9] btrfs: test snapshotting encrypted subvol Sweet Tea Dorminy
2023-08-08 18:46 ` Sweet Tea Dorminy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a8634ac9-cadb-0aca-d079-6b6bac77935d@oracle.com \
--to=anand.jain@oracle.com \
--cc=ebiggers@google.com \
--cc=fdmanana@suse.com \
--cc=fstests@vger.kernel.org \
--cc=fsverity@lists.linux.dev \
--cc=kernel-team@meta.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fscrypt@vger.kernel.org \
--cc=sweettea-kernel@dorminy.me \
--cc=zlang@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).