All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.vnet.ibm.com>
To: Matthew Garrett <mjg59@google.com>
Cc: linux-integrity <linux-integrity@vger.kernel.org>
Subject: Re: [PATCH V3 2/2] EVM: Allow runtime modification of the set of verified xattrs
Date: Tue, 08 May 2018 17:43:02 -0400	[thread overview]
Message-ID: <1525815782.3551.86.camel@linux.vnet.ibm.com> (raw)
In-Reply-To: <CACdnJuvUze0GSmQcnyFi_3vGEPoEgavrF9WhFoDpmHSni3FwEA@mail.gmail.com>

On Tue, 2018-05-08 at 21:30 +0000, Matthew Garrett wrote:
> On Wed, May 2, 2018 at 8:17 PM Mimi Zohar <zohar@linux.vnet.ibm.com> wrote:
> > On Tue, 2018-05-01 at 10:51 -0700, Matthew Garrett wrote:
> > > +             Shows the set of extended attributes used to calculate or
> > > +             validate the EVM signature, and allows additional
> attributes
> > > +             to be added at runtime. Adding additional extended
> attributes
> > > +             will result in any existing signatures generated without
> the
> > > +             additional attributes becoming invalid, and any signatures
> > > +             generated after additional attributes are added will only
> be
> > > +             valid if the same additional attributes are configured on
> > > +             system boot.
> 
> > This needs to be updated ...
> 
> Yup.
> 
> > > +     if (*ppos != 0)
> > > +             return -EINVAL;
> 
> > Is there a maximum xattr name size?  Should there be?
> 
> There is - I'll add a check.
> 
> > > +     /* Remove any trailing newline */
> > > +     len = strlen(xattr->name);
> > > +     if (xattr->name[len-1] == '\n')
> > > +             xattr->name[len-1] = '\0';
> 
> > Shouldn't we somehow sanity check userspace provided strings, before
> > adding them to the list of xattrs?  Perhaps limit the string to the
> > upper and lower case letters?
> 
> As far as I can tell the VFS doesn't do that, and I wouldn't put it past
> someone to use UTF-8 at some point...

The audit subsystem uses audit_log_untrustedstrings() to check for
control characters.  I'm not sure what should be included, but not
checking userspace strings doesn't sound right.

> 
>   > +     evm_xattrs = securityfs_create_file("evm_xattrs", 0440, NULL, NULL,
> > > +                                         &evm_xattr_ops);
> > > +     if (!evm_xattrs || IS_ERR(evm_xattrs)) {
> > > +             securityfs_remove(evm_init_tpm);
> > > +             return -EFAULT;
> > > +     }
> > > +
> 
> > Do we really want this feature unconditionally enabled?  How often do
> > you expect to add xattrs?  Is there ever a point where you would want
> > to lock the list of xattrs from changing?
> 
> I think a config option would make sense here. Locking doesn't seem
> unreasonable, but I'm not sure what the threat model would really be -
> adding new xattrs would only result in additional signatures validating if
> they were signed with a trusted key in the first place.

Remember adding additional EVM xattrs isn't limited to just EVM
signatures, but for the original EVM HMAC as well.  Did you want to
limit it to the EVM portable & immutable signatures?

Mimi

  reply	other threads:[~2018-05-08 21:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-01 17:51 [PATCH V3 1/2] EVM: turn evm_config_xattrnames into a list Matthew Garrett
2018-05-01 17:51 ` [PATCH V3 2/2] EVM: Allow runtime modification of the set of verified xattrs Matthew Garrett
2018-05-03  3:17   ` Mimi Zohar
2018-05-08 21:30     ` Matthew Garrett
2018-05-08 21:43       ` Mimi Zohar [this message]
2018-05-08 22:51         ` Matthew Garrett
2018-05-09 15:00           ` Mimi Zohar
2018-05-09 17:40             ` Matthew Garrett
2018-05-03  2:48 ` [PATCH V3 1/2] EVM: turn evm_config_xattrnames into a list Mimi Zohar
  -- strict thread matches above, loose matches on Subject: below --
2018-05-08 22:41 Matthew Garrett
2018-05-08 22:41 ` [PATCH V3 2/2] EVM: Allow runtime modification of the set of verified xattrs Matthew Garrett

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=1525815782.3551.86.camel@linux.vnet.ibm.com \
    --to=zohar@linux.vnet.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=mjg59@google.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.