All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: James Morris <jmorris@namei.org>
Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>,
	linux-integrity@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, Miklos Szeredi <miklos@szeredi.hu>,
	Seth Forshee <seth.forshee@canonical.com>,
	Dongsu Park <dongsu@kinvolk.io>, Alban Crequy <alban@kinvolk.io>,
	"Serge E . Hallyn" <serge@hallyn.com>
Subject: Re: [PATCH v1 1/2] ima: fail signature verification on untrusted filesystems
Date: Mon, 19 Feb 2018 20:02:57 -0600	[thread overview]
Message-ID: <87tvucifji.fsf@xmission.com> (raw)
In-Reply-To: <alpine.LRH.2.21.1802201152240.883@namei.org> (James Morris's message of "Tue, 20 Feb 2018 11:52:42 +1100 (AEDT)")

James Morris <jmorris@namei.org> writes:

> On Mon, 19 Feb 2018, Eric W. Biederman wrote:
>
>> Mimi Zohar <zohar@linux.vnet.ibm.com> writes:
>> 
>> > Files on untrusted filesystems, such as fuse, can change at any time,
>> > making the measurement(s) and by extension signature verification
>> > meaningless.
>> 
>> Filesystems with servers?
>> Remote filesystems?
>> Perhaps unexpected changes.
>> 
>> Untrusted sounds a bit harsh, and I am not certain it quite captures
>> what you are looking to avoid.
>
> Right -- I think whether you trust a filesystem or not depends on how much 
> assurance you have in your specific configuration, rather than whether you 
> think the filesystem can be manipulated or not.
>
> There is a difference between:
>
>   - This fs has no way to communicate a change to IMA, and;
>
>   - This fs could be malicious.
>
> In the latter case, I suggest that any fs could be malicious if the 
> overall security policy / settings are inadequate for the threat model, or 
> if there are vulnerabilities which allow such security to be bypassed.
>
> Whether a user trusts FUSE on their particular system should be a policy 
> decision on the part of the user.  The kernel should not be deciding what 
> is trusted or not trusted here.

I believe there has been a good techincal argument made that fuse
mounted by an malicious user can defeat the protections ima is trying to
provide.

In particular the file could change after the signature of the file has
been verified without ima being alerted.

As such I think it is very reasonable for ima when a fuse filesystem has
been mounted by an unprivileged user to report that it can not verify
signatures, because IMA can not verify signatures in a meaningful way.

Now that might be better called SB_I_IMA_UNVERIFIABLE_SIGNATURES.

We may want to complement that flag with SB_I_UNTRUSTED_MOUNTER.
For the times when it is not the global root user who mounts
the filesystem.

So I do think when both conditions are true there very much is a case
for the kernel saying realizing it would be stupid to trust sigantures
it can not reliably verify.

On the flip side when it really is a trusted mounter, and it is in a
configuration that IMA has a reasonable expectation of seeing all of
the changes it would be nice if we can say please trust this mount.

It would also be nice if I could provide all of this information at
mount time (when I am the global root) with mount options.  So I don't
need to update all of my tooling to know how to update ima policy when I
am mounting a filesystem.

Eric

WARNING: multiple messages have this Message-ID (diff)
From: ebiederm@xmission.com (Eric W. Biederman)
To: linux-security-module@vger.kernel.org
Subject: [PATCH v1 1/2] ima: fail signature verification on untrusted filesystems
Date: Mon, 19 Feb 2018 20:02:57 -0600	[thread overview]
Message-ID: <87tvucifji.fsf@xmission.com> (raw)
In-Reply-To: <alpine.LRH.2.21.1802201152240.883@namei.org> (James Morris's message of "Tue, 20 Feb 2018 11:52:42 +1100 (AEDT)")

James Morris <jmorris@namei.org> writes:

> On Mon, 19 Feb 2018, Eric W. Biederman wrote:
>
>> Mimi Zohar <zohar@linux.vnet.ibm.com> writes:
>> 
>> > Files on untrusted filesystems, such as fuse, can change at any time,
>> > making the measurement(s) and by extension signature verification
>> > meaningless.
>> 
>> Filesystems with servers?
>> Remote filesystems?
>> Perhaps unexpected changes.
>> 
>> Untrusted sounds a bit harsh, and I am not certain it quite captures
>> what you are looking to avoid.
>
> Right -- I think whether you trust a filesystem or not depends on how much 
> assurance you have in your specific configuration, rather than whether you 
> think the filesystem can be manipulated or not.
>
> There is a difference between:
>
>   - This fs has no way to communicate a change to IMA, and;
>
>   - This fs could be malicious.
>
> In the latter case, I suggest that any fs could be malicious if the 
> overall security policy / settings are inadequate for the threat model, or 
> if there are vulnerabilities which allow such security to be bypassed.
>
> Whether a user trusts FUSE on their particular system should be a policy 
> decision on the part of the user.  The kernel should not be deciding what 
> is trusted or not trusted here.

I believe there has been a good techincal argument made that fuse
mounted by an malicious user can defeat the protections ima is trying to
provide.

In particular the file could change after the signature of the file has
been verified without ima being alerted.

As such I think it is very reasonable for ima when a fuse filesystem has
been mounted by an unprivileged user to report that it can not verify
signatures, because IMA can not verify signatures in a meaningful way.

Now that might be better called SB_I_IMA_UNVERIFIABLE_SIGNATURES.

We may want to complement that flag with SB_I_UNTRUSTED_MOUNTER.
For the times when it is not the global root user who mounts
the filesystem.

So I do think when both conditions are true there very much is a case
for the kernel saying realizing it would be stupid to trust sigantures
it can not reliably verify.

On the flip side when it really is a trusted mounter, and it is in a
configuration that IMA has a reasonable expectation of seeing all of
the changes it would be nice if we can say please trust this mount.

It would also be nice if I could provide all of this information at
mount time (when I am the global root) with mount options.  So I don't
need to update all of my tooling to know how to update ima policy when I
am mounting a filesystem.

Eric

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2018-02-20  2:03 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 15:18 [PATCH v1 0/2] ima: untrusted filesystems Mimi Zohar
2018-02-19 15:18 ` Mimi Zohar
2018-02-19 15:18 ` [PATCH v1 1/2] ima: fail signature verification on " Mimi Zohar
2018-02-19 15:18   ` Mimi Zohar
2018-02-19 21:47   ` Eric W. Biederman
2018-02-19 21:47     ` Eric W. Biederman
2018-02-20  0:52     ` James Morris
2018-02-20  0:52       ` James Morris
2018-02-20  2:02       ` Eric W. Biederman [this message]
2018-02-20  2:02         ` Eric W. Biederman
2018-02-20 14:02         ` Mimi Zohar
2018-02-20 14:02           ` Mimi Zohar
2018-02-20 14:02           ` Mimi Zohar
2018-02-20 20:16           ` Serge E. Hallyn
2018-02-20 20:16             ` Serge E. Hallyn
2018-02-20 20:16             ` Serge E. Hallyn
2018-02-21 14:46             ` Mimi Zohar
2018-02-21 14:46               ` Mimi Zohar
2018-02-21 14:46               ` Mimi Zohar
2018-02-21 22:46               ` Eric W. Biederman
2018-02-21 22:46                 ` Eric W. Biederman
2018-02-21 22:46                 ` Eric W. Biederman
2018-02-21 22:57                 ` Mimi Zohar
2018-02-21 22:57                   ` Mimi Zohar
2018-02-21 22:57                   ` Mimi Zohar
2018-02-21 23:12                   ` Eric W. Biederman
2018-02-21 23:12                     ` Eric W. Biederman
2018-02-21 23:12                     ` Eric W. Biederman
2018-02-21 23:32                     ` Mimi Zohar
2018-02-21 23:32                       ` Mimi Zohar
2018-02-21 23:32                       ` Mimi Zohar
2018-02-27  2:12                       ` Eric W. Biederman
2018-02-27  2:12                         ` Eric W. Biederman
2018-02-27  2:12                         ` Eric W. Biederman
2018-02-21 22:53           ` Eric W. Biederman
2018-02-21 22:53             ` Eric W. Biederman
2018-02-21 22:53             ` Eric W. Biederman
2018-02-21 23:03             ` Mimi Zohar
2018-02-21 23:03               ` Mimi Zohar
2018-02-21 23:03               ` Mimi Zohar
2018-02-19 22:50   ` kbuild test robot
2018-02-19 22:50     ` kbuild test robot
2018-02-19 22:50     ` kbuild test robot
2018-02-19 23:36   ` kbuild test robot
2018-02-19 23:36     ` kbuild test robot
2018-02-19 23:36     ` kbuild test robot
2018-02-19 15:18 ` [PATCH v1 2/2] fuse: define the filesystem as untrusted Mimi Zohar
2018-02-19 15:18   ` Mimi Zohar

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=87tvucifji.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=alban@kinvolk.io \
    --cc=dongsu@kinvolk.io \
    --cc=jmorris@namei.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=serge@hallyn.com \
    --cc=seth.forshee@canonical.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.