linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Mimi Zohar <zohar@linux.ibm.com>
Cc: Chuck Lever <chuck.lever@oracle.com>,
	linux-integrity@vger.kernel.org,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Michael Halcrow <mhalcrow@google.com>,
	"Theodore Y. Ts'o" <tytso@google.com>,
	Matthew Garrett <mjg59@google.com>,
	Eric Biggers <ebiggers@google.com>
Subject: Re: IMA on remote file systems
Date: Mon, 16 Sep 2019 12:10:55 -0400	[thread overview]
Message-ID: <20190916161054.GB4553@mit.edu> (raw)
In-Reply-To: <1568583730.5055.36.camel@linux.ibm.com>

On Sun, Sep 15, 2019 at 05:42:10PM -0400, Mimi Zohar wrote:
> > > My thought was to use an ephemeral Merkle tree for NFS (and
> > > possibly other remote filesystems, like FUSE, until these
> > > filesystems support durable per-file Merkle trees). A tree would
> > > be constructed when the client measures a file, but it would not
> > > saved to the filesystem. Instead of a hash of the file's contents,
> > > the tree's root signature is stored as the IMA metadata.
> > > 
> > > Once a Merkle tree is available, it can be used in exactly the
> > > same way that a durable Merkle tree would, to verify the integrity
> > > of individual pages as they are used, evicted, and then read back
> > > from the server.
> > > 
> > > If the client needs to evict part or all of an ephemeral tree, it
> > > can subsequently be reconstructed by measuring the file again and
> > > verifying its root signature against the stored IMA metadata.

Where would the client store the ephemeral tree?  If you're thinking
about storing in memory, calculating the emphemeral tree would require
dragging the entire file across the network, which is going to be just
as bad as using IMA --- plus the CPU cost of calculating the Merkle
tree, and the memory cost of storing the ephemeral Merkle tree.

I suspect that for most clients, it wouldn't be worth it unless the
client can store the ephemeral tree *somewhere* on the client's local
persistent storage, or maybe if it could store the Merkle tree on the
NFS server (maybe via an xattr which contains the pathname to the
Merkle tree relative to the NFS mount point?).

> > > So the only difference here is that the latency-to-first-byte
> > > benefit of a durable Merkle tree would be absent.

What problem are you most interested in solving?  And what cost do you
think the user will be willing to pay in order to solve that problem?

> I like the idea, but there are a couple of things that need to happen
> first.  Both fs-verity and IMA appended signatures need to be
> upstreamed.

Eric has sent the pull request fs-verity today.

>  The IMA appended signature support simplifies
> ima_appraise_measurement(), paving the way for adding IMA support for
> other types of signature verification.  How IMA will support fs-verity 
> signatures still needs to be defined.  That discussion will hopefully
> include NFS support.

As far as using the Merkle tree root hash for the IMA measurement,
what sort of policy should be used for determining when the Merkle
tree root hash should be used in preference to reading and checksuming
the whole file when it is first opened?  It could be as simple as, "if
this is a fs-verity, use the fs-verity Merkle root".  Is that OK?

     	  	     	     	       	      - Ted

  reply	other threads:[~2019-09-16 16:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28 17:36 IMA on remote file systems Chuck Lever
2019-09-13 14:50 ` Chuck Lever
2019-09-15 21:42   ` Mimi Zohar
2019-09-16 16:10     ` Theodore Y. Ts'o [this message]
2019-09-16 18:16       ` Chuck Lever
2019-09-16 13:16 ` Janne Karhunen
2019-09-16 14:47   ` Chuck Lever
2019-09-17  6:30     ` Janne Karhunen
2019-09-17 12:45       ` Theodore Y. Ts'o
2019-09-17 14:18         ` Mimi Zohar
2019-09-17 14:56         ` James Bottomley
2019-09-18  5:27           ` Janne Karhunen
2019-09-18 12:50             ` Theodore Y. Ts'o
2019-09-18 15:52             ` James Bottomley
2019-09-19  6:47               ` Janne Karhunen
2019-09-18 12:37           ` Theodore Y. Ts'o
2019-09-18 14:40             ` Mimi Zohar
2019-09-18 15:49             ` James Bottomley

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=20190916161054.GB4553@mit.edu \
    --to=tytso@mit.edu \
    --cc=chuck.lever@oracle.com \
    --cc=ebiggers@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=mhalcrow@google.com \
    --cc=mjg59@google.com \
    --cc=tytso@google.com \
    --cc=zohar@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).