linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [LSF/MM TOPIC] fs-verity: file system-level integrity protection
       [not found] <20180125191152.GA11197@thunk.org>
@ 2018-01-26 17:54 ` Mimi Zohar
       [not found] ` <1516927666.4082.25.camel@HansenPartnership.com>
  1 sibling, 0 replies; 3+ messages in thread
From: Mimi Zohar @ 2018-01-26 17:54 UTC (permalink / raw)
  To: Theodore Ts'o, lsf-pc; +Cc: linux-fsdevel, linux-integrity

[Cc'ing the linux-integrity mailing list]

On Thu, 2018-01-25 at 14:11 -0500, Theodore Ts'o wrote:
> I'd like to talk about a proposal to implement and upstream something
> that we've been calling fs-verity, which is something like dm-verity,
> but implemnted on a per-file basis.  It will be implemnted much like
> fs/crypto, in that most of the code will be in a generic layer, with
> minimal modifications needed in the file system layer.
> 
> The merkle tree will be located after file's normal data, and then
> after the package manager sets the verity bit, i_size will be updated
> so that the fs-verity header and merkle tree will be "hidden" from
> userspace and the file will become immutable.
> 
> How does this differ from IMA's file integrity?
> 
> *) 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.

Secure and trusted boot standards require files to be measured and
appraised before usage.  Perhaps verifying the merkle tree satifies
these requirements.

IMA-appraisal is being extended to support appended signatures, as
generated by scripts/sign-file.  This proposed method of calculating
the file hash could be another signature method.

> *) The design and code are done by file system developers, so it
> doesn't have the locking problems of the IMA code.

True, the locking problem is a direct result of using xattrs for
storing file metadata, which requires taking the i_rwsem exclusively
for writing.  This solution circumvents the locking issues because it
appends the file metadata to the file data instead of using xattrs.

By using atomic flags, as suggested by Linus, Dmitry Kasatkin has
resolved the xattr locking issue.  The patch is currently staged to
be upstreamed in the next open window.

> 
> The initial use case of this will be for Android, where the latency
> concerns of doing the full checksum at file open time is important.
> 
> In the future, the fact that a file has been signed using fs-verity,
> using a PKCS 11 signature with a key on a trusted keyring (possibly
> the same one used for signed kernel modules, or perhaps a separate
> keyring) could be used as input into a security policy which requires
> this for say, setuid executables, setuid shell scripts, etc.
> 
> 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.

Signing and verifying local file signatures, is a lot simpler than
supporting a full software package life cycle.  Can the file metadata
- signatures and trees - be calculated and included in software
packages, with the file data, for distribution?

In terms of remote filesystems, the same trust issues exist with this
solution as with IMA-appraisal.

Mimi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [LSF/MM TOPIC] fs-verity: file system-level integrity protection
       [not found]       ` <20180126145856.GA2841@thunk.org>
@ 2018-01-26 18:13         ` Mimi Zohar
       [not found]         ` <1516985067.4000.10.camel@HansenPartnership.com>
  1 sibling, 0 replies; 3+ messages in thread
From: Mimi Zohar @ 2018-01-26 18:13 UTC (permalink / raw)
  To: Theodore Ts'o, James Bottomley; +Cc: lsf-pc, linux-fsdevel, linux-integrity

[Cc'ing linux-integrity]

On Fri, 2018-01-26 at 09:58 -0500, Theodore Ts'o wrote:

> > 
> > Currently container images are simple tar files and one of the main
> > value adds of docker as a tool is the simplicity of the image creation
> > process.  That process depends on standard tools like tar to create the
> > image, so I was trying to fit this proposal into that process.
> 
> The goal of fs-verity is protect arbitrary files without breaking the
> backwards compatibility of those that *read* the file.  So for
> example, an APK file is downloaded and verified at the intial download
> --- and never verified again.  It is *used* many times after the
> initial download (and hence, potentially after an evil maid attack),
> and this is done by many different tools, including by code inside the
> APK itself.  So it is not feasible to change the tools that read the
> APK, which means we can't make any backwards-incompatible changes to
> the file itself.
> 
> However, changing the tools that *establish* the locally verified copy
> is considered completely fair game.  I'll note that this is true no
> matter what system you use.  If you are using IMA, after the file is
> downloaded, you still have to set the magic "trusted xattr" (which, I
> will note, requires root access since it is a trusted root access).
> So you have to make at least *some* changes to the code path which
> writes the file that you want to be integrity protected.  In the case
> of IMA, this includes code that has to run as root.

Different types of software packages (eg. tar, rpm, multiple deb
prototypes) can be built to include file signatures.  Both the file
data and metadata (eg. signatures) would be installed together by the
same app, which already has root privileges needed to install them.

Mimi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Lsf-pc] [LSF/MM TOPIC] fs-verity: file system-level integrity protection
       [not found]               ` <1517069959.3012.13.camel@HansenPartnership.com>
@ 2018-01-27 17:08                 ` James Bottomley
  0 siblings, 0 replies; 3+ messages in thread
From: James Bottomley @ 2018-01-27 17:08 UTC (permalink / raw)
  To: Andreas Dilger, Theodore Ts'o; +Cc: linux-fsdevel, lsf-pc, linux-integrity

[-- Attachment #1: Type: multipart/signed, Size: 5564 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-27 17:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20180125191152.GA11197@thunk.org>
2018-01-26 17:54 ` [LSF/MM TOPIC] fs-verity: file system-level integrity protection Mimi Zohar
     [not found] ` <1516927666.4082.25.camel@HansenPartnership.com>
     [not found]   ` <20180126023054.GC31091@thunk.org>
     [not found]     ` <1516942235.4082.52.camel@HansenPartnership.com>
     [not found]       ` <20180126145856.GA2841@thunk.org>
2018-01-26 18:13         ` Mimi Zohar
     [not found]         ` <1516985067.4000.10.camel@HansenPartnership.com>
     [not found]           ` <20180126215540.GA23308@thunk.org>
     [not found]             ` <275E5E86-635E-4D79-9AC9-3D24318EDDDF@dilger.ca>
     [not found]               ` <1517069959.3012.13.camel@HansenPartnership.com>
2018-01-27 17:08                 ` [Lsf-pc] " James Bottomley

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).