From: Theodore Ts'o <tytso@mit.edu>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Andreas Dilger <adilger@dilger.ca>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
lsf-pc@lists.linux-foundation.org
Subject: Re: [Lsf-pc] [LSF/MM TOPIC] fs-verity: file system-level integrity protection
Date: Sun, 28 Jan 2018 16:49:25 -0500 [thread overview]
Message-ID: <20180128214925.GA13621@thunk.org> (raw)
In-Reply-To: <1517162590.3082.55.camel@HansenPartnership.com>
On Sun, Jan 28, 2018 at 10:03:10AM -0800, James Bottomley wrote:
>
> OK, so we agree then that what IMA provides: a hash and potential
> signature over the hash is sufficient input for what you want and does
> provide existing tooling to achieve it.
Well, that's not all IMA provides. Remmber, the 'M' in IMA is
*measurement*. IMA was originally about checksuming every single file
that is opened and writing it to a long. You could suppress it by
using SELinux to tag files (using xattrs which are *not* signed) and
then writing an IMA policy which tells IMA to ignore files that belong
to a certain SE Linux tag. This is something that I *don't* want and
today, enabling CONFIG_IMA drags all of this (including doing text
parsing of the IMA policy in the kernel, SELinux, etc.) into the
kernel.
One of my other complaints about IMA is that it's an integrated
solution, with a huge amount of complexity. If it was only about file
signing, that would be one thing, but that's actually not the case
today. Hence my comment about I don't want fs-verity to have a
dependency on IMA, such that we are forced to drag in all of IMA and
SELinux for anyone who wants to use use fs-verity.
This is fine; I don't want to have to dictate changes to IMA; I'd much
prefer to avoid the complexity instead of trying to reform it, since
I'm sure the IMA folks will be happy to explain why there are all
sorts of reasons why things have to be done the way it has to be done.
For example, the assertion that the latency hit at open(2) *must* be
there in order to kowtow to Microsoft because of its Trusted Boot
policies; fair enough, but *I* don't care about Trusted Boot, and it's
not fair to impose penalties on all scenarios because of a desire to
keep Microsoft happy just for one particular use case.
> 1. Could the signature piece of this be done in the way IMA currently
> does file signatures. �We all agree "yes" on this, since a signed
> mekle hash head is the same size as an existing IMA signature and
> therefore does fit into xattrs.
Well.... not exactly.
It is fair to say that there are two parts of integrity metadata; and
the Merkle tree can be reconstructed at file install time.
> 2. Could IMA use a merkle tree for hash verification a page at a time
> as part of its implementation? �I think the answer to this is yes,
> except the hook has to be somewhere in the page fault mechanism, so
> it would need some exploration and prototyping.
The way you are formulating things presumes that all of IMA has to be
dragged into any file integrity solution. That's begging the
question. As I've mentioned above, IMA has all sorts of complexity
which is currently mandatory, and I'm not volunteering to disentagling
the mess to make it be sane. (And if you don't like that word, how
about, "designed with good taste?")
> 3. Could the merkle tree be cached somehow in the filesystem (probably
> as part of the filesystem implementaiton)? �You've already assumed
> "yes" for this since it's how fs-verity is proposed to work.
I don't consider this the Merkel tree to a *cache*, however because if
you don't mind a massive latency at file open tme, you can just use
the existing IMA mechanism. So a core part of the design is that the
Merkle file is stored permanently (*not* as a cache) alongside the
file. And if the file is renamed, the Merkle tree should come along
for the ride.
Whether the Merkle tree is reconstructed as part of the file / package
installation process, or whether the Merkle tree stored as part of the
package or streamed from the app store, etc., is an implementation
detail, and I don't think we need to prescribe one way of doing
things. I *do* think though we should allow for possibility where
limitations on the local CPU power is such that it would be preferable
for the Merkle tree to be supplied from a remote server instead of
generated on the local system.
The problem is you have a specific use case in mind, involving the
Docker client, where you want to store the signature in an xattr, and
then not require any local changes to the Docker client --- and that's
not in my requirements set, and it was *your* statement that the
Docker client MUST NOT be modified which forced where (a) the Merkle
tree must be reconstructed in the kernel, and (b) it must be triggered
by setting the xattr.
My goal is to keep things simple, which means
* No parsing of the IMA policy as a text input in the kernel
* No Merkle tree construction in the kernel (which is also true of dm-verity)
* No magic xattr triggering
Speaking as a kernel developer, it makes a more sense to keep things
in the kernel, and do as much in userspace as possible --- and if that
means that the Docker client (or the package manager, etc.) needs a
minor change to call the userspace library, that's infinitely
preferable to keeping huge amounts of complexity in non-swappable
kernel memory --- which increases the attack surface of the kernel,
and so on.
So in my opinion, clean design of the kernel trumps the requirement of
"not one change, not one jot, in the Docker client".
It could be that the requiremnts of "keep the kernel changes simple"
and "no massive latency at file open time", means that requiremnt sets
of fs-verity and IMA are irreconcilable. Which is fine as far as I'm
concerned. Maybe IMA and fs-verity should be considered orthogonal
solutions.
- Ted
next prev parent reply other threads:[~2018-01-28 22:01 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
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 [this message]
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=20180128214925.GA13621@thunk.org \
--to=tytso@mit.edu \
--cc=James.Bottomley@HansenPartnership.com \
--cc=adilger@dilger.ca \
--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).