From: Eric Biggers <ebiggers@kernel.org>
To: Josef Bacik <josef@toxicpanda.com>
Cc: linux-fscrypt@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] fscrypt: track master key presence separately from secret
Date: Mon, 16 Oct 2023 22:13:13 -0700 [thread overview]
Message-ID: <20231017051313.GD1907@sol.localdomain> (raw)
In-Reply-To: <20231016182337.GA2339326@perftesting>
On Mon, Oct 16, 2023 at 02:23:37PM -0400, Josef Bacik wrote:
> On Sat, Oct 14, 2023 at 11:10:55PM -0700, Eric Biggers wrote:
> > From: Eric Biggers <ebiggers@google.com>
> >
> > Master keys can be in one of three states: present, incompletely
> > removed, and absent (as per FSCRYPT_KEY_STATUS_* used in the UAPI).
> > Currently, the way that "present" is distinguished from "incompletely
> > removed" internally is by whether ->mk_secret exists or not.
> >
> > With extent-based encryption, it will be necessary to allow per-extent
> > keys to be derived while the master key is incompletely removed, so that
> > I/O on open files will reliably continue working after removal of the
> > key has been initiated. (We could allow I/O to sometimes fail in that
> > case, but that seems problematic for reasons such as writes getting
> > silently thrown away and diverging from the existing fscrypt semantics.)
> > Therefore, when the filesystem is using extent-based encryption,
> > ->mk_secret can't be wiped when the key becomes incompletely removed.
> >
> > As a prerequisite for doing that, this patch makes the "present" state
> > be tracked using a new field, ->mk_present. No behavior is changed yet.
> >
> > The basic idea here is borrowed from Josef Bacik's patch
> > "fscrypt: use a flag to indicate that the master key is being evicted"
> > (https://lore.kernel.org/r/e86c16dddc049ff065f877d793ad773e4c6bfad9.1696970227.git.josef@toxicpanda.com).
> > I reimplemented it using a "present" bool instead of an "evicted" flag,
> > fixed a couple bugs, and tried to update everything to be consistent.
> >
> > Note: I considered adding a ->mk_status field instead, holding one of
> > FSCRYPT_KEY_STATUS_*. At first that seemed nice, but it ended up being
> > more complex (despite simplifying FS_IOC_GET_ENCRYPTION_KEY_STATUS),
> > since it would have introduced redundancy and had weird locking rules.
> >
> > Signed-off-by: Eric Biggers <ebiggers@google.com>
>
> Based my fscrypt patches ontop of this one, ran tests with both btrfs and ext4
> with it applied, in addition to my normal review stuff. You can add
>
> Reviewed-by: Josef Bacik <josef@toxicpanda.com>
>
Thanks. I went ahead and applied this patch to the fscrypt tree.
- Eric
next prev parent reply other threads:[~2023-10-17 5:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-15 6:10 [PATCH] fscrypt: track master key presence separately from secret Eric Biggers
2023-10-16 18:23 ` Josef Bacik
2023-10-17 5:13 ` Eric Biggers [this message]
2023-10-16 22:28 ` Neal Gompa
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=20231017051313.GD1907@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fscrypt@vger.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).