From: Theodore Ts'o <tytso@mit.edu>
To: Michael Halcrow <mhalcrow@google.com>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH RFC 2/2] ext4 crypto: add ioctls to allow backup of encryption metadata
Date: Wed, 9 Dec 2015 08:38:34 -0500 [thread overview]
Message-ID: <20151209133834.GA8898@thunk.org> (raw)
In-Reply-To: <20151208213215.GA5469@google.com>
On Tue, Dec 08, 2015 at 01:32:15PM -0800, Michael Halcrow wrote:
>
> Looks like something went wonky here.
Oops, fixed.
> > +/**
> > + * Structure used for communicating encrypted metadata with userspace
> > + */
> > +struct ext4_encrypted_metadata {
> > + u32 len;
> > + char metadata[288];
>
> Did you choose 288 because of the max encrypted file name length?
>
> While struct ext4_encryption_context is currently 28 bytes, it could
> conceivably get much larger with more advanced key management
> features. E.g., supporting multiple users' keys per file.
>
> Do you think it's worth anticipating this with a version number? Or
> plan on something like adding another IOCTL if we end up needing more
> space?
For the ioctl's that do a GET, the caller is required to initialize
mdata.len to the size of the metadata array, and then the kernel
returns the actual size in mdata.len. (I suppose that means I should
have used _IORW for the ioctl encoding for
EXT4_IOC_GET_ENCRYPTION_METADATA and EXT4_IOC_SET_ENCRYPTION_METADATA.
I'll fix that in the next spin of the patches.)
At the moment we just blindly copy the entire ext4_encrypted_metadata
structure in and out of userspace, mainly because it's much easier,
and because today there is no way for the ioctl's to return more than
256 bytes (I added 32 bytes worth of padding just in case some day we
want to support a crypto system that requires an explicit IV for
filename encryption, although at the moment we don't have a way to
encode this in the on-disk directory entry.)
But the way I constructed the interface, it *is* possible to support
larger metadata sizes for things like public keys, etc., should we
ever decide to go down that path.
Cheers,
- Ted
prev parent reply other threads:[~2015-12-09 13:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-08 20:51 [PATCH RFC 1/2] ext4 crypto: add ciphertext_access mount option Theodore Ts'o
2015-12-08 20:51 ` [PATCH RFC 2/2] ext4 crypto: add ioctls to allow backup of encryption metadata Theodore Ts'o
2015-12-08 21:32 ` Michael Halcrow
2015-12-09 13:38 ` Theodore Ts'o [this message]
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=20151209133834.GA8898@thunk.org \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
--cc=mhalcrow@google.com \
/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