From: Theodore Ts'o <tytso@mit.edu>
To: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
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 21:38:20 -0500 [thread overview]
Message-ID: <20180129023820.GA1565@thunk.org> (raw)
In-Reply-To: <1517190821.29187.415.camel@linux.vnet.ibm.com>
On Sun, Jan 28, 2018 at 08:53:41PM -0500, Mimi Zohar wrote:
> A lot of people have requested being able to identify files based on
> pathnames. �I don't need to tell you this isn't safe from a security
> perspective. �So how would you identify these few files? �I doubt you
> are planning on hard coding them. �If you have a generic solution, I
> would really be interested in hearing it.
So what we are implementing with fs-verity is that verification is
enabled by setting a flag in the inode ("the verity bit") which causes
the file system to enforce the data integrity checks. This bit can be
checked by using the FS_IOC_GETFLAGS ioctl (like any of the other
existing file system flags, such as immutable, append-only, no-COW,
etc.)
What this means is that it would be possible for userspace application
to simply open a file (which might, for example, be a privileged APK)
and before using it, check the verity bit via the open file
descriptor. If the verity bit is set, then the userspace application
can safely read from the file, and no that it hasn't been tampered
with, even via an off-line evil maid attack. In this particular case
case, there isn't even a need to use SELinux, or indeed, any LSM at
all. No need to compile in EVM, no need to compile in IMA, no need to
compile in SELinux, etc.
In other use cases, whether or not a file has the verity bit set could
be used by an LSM that wishes to make policy restrictions --- for
example: "if the file is setuid, then the verity bit *must* be set".
Or there could be a policy where all executables *must* have the
verity bit set. This model has the advantage of a very clean
separation between the policy and the mechanism, where the mechanism
exports a single bit, "is this file one which is protected by the
verity bit"?
Granted, it is a different model than what IMA/EVM use. But it is
much simpler, and it is optimized for use cases where most of the
files might not be data integrity protected (perhaps because most of
then security-critical files are located on a read-only volume being
protected using dm-verity).
Because we use a Merkle tree, we are also making the tradeoff between
a complete verification of the entire contents of the file at file
open time (which imposes a file open latency, and means that if the
file can be tampered after it is opened, IMA won't detect the
problem), versus verification at readpage time (which means that you
might fail while reading the file, instead of finding out at open
time). This is again consistent with dm-verity, where we do not
attempt to verify the checksum of the entire block device at system
startup; instead we check on each block read, and if the verification
fails, we fail the read in question.
For some use cases, the use of a full-file hash ala today's
IMA-Appraisal might be a better choice. I have never claimed that
fs-verity was intended to be a replacemnt for IMA.
Cheers,
- Ted
P.S. I wonder if it was a mistake to not choose a whole new name for
IMA-Appraisal. There are lots of documentations on the web which talk
about "IMA", and it's not clear if it supposed to mean "IMA-Measure",
or a generic term encompassing "IMA-Appraisal" and "IMA-Meaure". One
might be able to guess based on how out-of-date the rest of web page
happens to be, but it's really not clear.
Also, the two concepts are quite different, and data integrity via
checking a digitally signed hash is only partially related to
"measuring" a file. Perhaps it's related by virtue of the fact that
you have to calculate a cryptographic checksum over the entire file.
But once you get to data integrity protected via a Merkle tree at file
read time, this is extremely quite far away from any traditional
definition of "measurement". So purely from a naming convention,
perhaps trying to take data integrity verification using Merkle trees
should forcing it into the IMA framework might not be such a great
fit.
next prev parent reply other threads:[~2018-01-29 2:38 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
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 [this message]
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=20180129023820.GA1565@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 \
--cc=zohar@linux.vnet.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).