From: Theodore Ts'o <tytso@mit.edu>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: lsf-pc@lists.linux-foundation.org,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [LSF/MM TOPIC] fs-verity: file system-level integrity protection
Date: Thu, 25 Jan 2018 21:30:54 -0500 [thread overview]
Message-ID: <20180126023054.GC31091@thunk.org> (raw)
In-Reply-To: <1516927666.4082.25.camel@HansenPartnership.com>
On Thu, Jan 25, 2018 at 04:47:46PM -0800, James Bottomley wrote:
>
> How do you know the file is in this special format? �Would it be a per
> filesystem flag (so every file) or selectable per-file by some other
> mechanism. �If it's per-file, why not simply use the existing xattr
> mechanism?
It would be using a per-file flag, just like we do with fscrypt.
Given that we only need a single bit of information, using an xattr
would be a inefficeint.
> > *) The pages are verified as they are read, so pages are verified as
> > they are read the storage device; this avoids a large latency hit
> > when the file is first opened or referenced.
>
> The cost of this is presumably one hash per page in the tree, so it
> costs quite a bit in terms of space. �Presumably the hash tree is also
> dynamically resident meaning a page fault could now also potentially
> fault in the hash tree, leading to a lot of sub optimal I/O patterns?
This is how dm-verity works, which is used on every single modern
Chrome OS and Android phone, with no complaints. (It doesn't work
that way on your phone, unless you've upgraded. :-)
> > *) The design and code are done by file system developers, so it
> > doesn't have the locking problems of the IMA code.
>
> That's a bit unfair. �My next question was going to be why not just
> make this an actual IMA mode (meaning you could choose to have a global
> hash or a tree hash). �Does this mean that a-priori you've already
> ruled out IMA integration because you don't want to work with the
> developers?
IMA has a lot of complexity, which I would rather not drag in as a
dependency. Also, having seen some of the ah, "discussions" that
Christoph and Dave Chinner have been having with the IMA folks, I'd
rather not taint this proposal with IMA's reputation. :-)
I am completely open to an optional integration with IMA, but I would
prefer not to require CONFIG_IMA to be enabled in order to use
fs-verity.
> PKCS11 is the standard for cryptokeys. �I presume you just mean a
> message signing standard like PKCS7 or RFC 2315?
Sorry, I meant PKCS7. It would be a restricted PKCS7 mode, using a
detached signature. My plan was to reuse the existing code we already
have written for signed kernel modules.
> > Most of this feature could also be used with a non-cryptographic
> > checksum to provide data checksums for read-only files in a general
> > way for all file systems.��It wouldn't be as flexible as btrfs, but
> > for files being stored for backup purposes, it should work quite
> > well.
>
> I assume the "write" part of this is that the file must be deleted and
> re-created?
I'm not sure what you mean. If you have an existing file that you
want to protect using fs-verity, it's a matter of appending the
fs-verity information onto the end of the file, and then setting the
fs-verity flag, at which point all of the fs-verity information
disappears from the perspective of stat(2) and read(2) system calls.
The verity bit can be examined using FS_IOC_GETFLAGS, and more details
about which key was used to sign the file could be examined via some
ioctl interface.
In general, though, it's expected that userspace won't care about such
details. Any reads that don't verify will return an error, and if the
key used to sign fs-verity information is not trusted by the kernel,
the open will return an error. So all userspace or a security policy
would need to take of is that file does have the verity bit set.
Cheers,
- Ted
next prev parent reply other threads:[~2018-01-26 2:31 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-25 19:11 [LSF/MM TOPIC] fs-verity: file system-level integrity protection Theodore Ts'o
2018-01-25 21:49 ` Chuck Lever
2018-01-25 23:39 ` Theodore Ts'o
2018-01-26 0:47 ` James Bottomley
2018-01-26 2:30 ` Theodore Ts'o [this message]
2018-01-26 4:50 ` James Bottomley
2018-01-26 14:58 ` Theodore Ts'o
2018-01-26 16:44 ` [Lsf-pc] " James Bottomley
2018-01-26 21:55 ` Theodore Ts'o
2018-01-27 7:58 ` Andreas Dilger
2018-01-27 16:19 ` James Bottomley
2018-01-27 17:08 ` James Bottomley
2018-01-28 2:46 ` Theodore Ts'o
2018-01-28 17:19 ` James Bottomley
2018-01-28 18:03 ` James Bottomley
2018-01-28 18:19 ` Chuck Lever
2018-01-29 6:39 ` James Bottomley
2018-01-29 15:22 ` Chuck Lever
2018-01-30 6:47 ` James Bottomley
2018-01-28 21:49 ` Theodore Ts'o
2018-01-28 22:49 ` Theodore Ts'o
2018-01-28 23:04 ` Mimi Zohar
2018-01-29 0:38 ` Theodore Ts'o
2018-01-29 1:53 ` Mimi Zohar
2018-01-29 2:38 ` Theodore Ts'o
2018-01-29 3:39 ` Mimi Zohar
2018-01-29 4:40 ` Theodore Ts'o
2018-01-29 4:50 ` Theodore Ts'o
2018-01-29 12:09 ` Mimi Zohar
2018-01-29 13:58 ` Mimi Zohar
2018-01-29 23:02 ` Theodore Ts'o
2018-01-30 23:25 ` Mimi Zohar
2018-01-31 16:05 ` Theodore Ts'o
2018-01-31 17:12 ` James Bottomley
2018-01-31 18:46 ` Theodore Ts'o
2018-01-31 20:41 ` James Bottomley
2018-02-01 0:03 ` Theodore Ts'o
2018-02-01 23:04 ` Dave Chinner
2018-02-01 23:43 ` Andreas Dilger
2018-02-02 0:13 ` Dave Chinner
2018-02-02 5:34 ` James Bottomley
2018-02-02 2:40 ` Theodore Ts'o
2018-02-02 9:05 ` Dave Chinner
2018-01-31 20:40 ` Mimi Zohar
2018-01-31 22:00 ` Theodore Ts'o
2018-02-01 15:17 ` Mimi Zohar
2018-01-29 0:21 ` James Bottomley
2018-01-29 1:03 ` Theodore Ts'o
2018-01-29 21:21 ` Andreas Dilger
2018-01-26 18:13 ` Mimi Zohar
2018-01-29 18:54 ` Michael Halcrow
2018-01-26 7:58 ` Colin Walters
2018-01-26 15:29 ` Theodore Ts'o
2018-01-26 16:40 ` Colin Walters
2018-01-26 16:49 ` [Lsf-pc] " James Bottomley
2018-01-26 17:05 ` Colin Walters
2018-01-26 17:54 ` Mimi Zohar
2018-02-02 0:02 ` Steve French
2018-02-07 13:04 ` David Gstir
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=20180126023054.GC31091@thunk.org \
--to=tytso@mit.edu \
--cc=James.Bottomley@HansenPartnership.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=lsf-pc@lists.linux-foundation.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).