All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Matthew Garrett <mjg59@google.com>
Cc: linux-integrity <linux-integrity@vger.kernel.org>,
	Mimi Zohar <zohar@linux.vnet.ibm.com>,
	prakhar srivastava <prsriva02@gmail.com>,
	Thiago Jung Bauermann <bauerman@linux.ibm.com>,
	Roberto Sassu <roberto.sassu@huawei.com>
Subject: Re: [PATCH V3] IMA: Allow profiles to define the desired IMA template
Date: Tue, 04 Jun 2019 16:16:21 -0400	[thread overview]
Message-ID: <1559679381.4237.9.camel@linux.ibm.com> (raw)
In-Reply-To: <CACdnJuvYzGBsAvmcP_6u+Zvr+AKTrKweJDbjurtZ02-HBbJN1Q@mail.gmail.com>

On Tue, 2019-06-04 at 13:03 -0700, Matthew Garrett wrote:
> On Mon, Jun 3, 2019 at 6:52 PM Mimi Zohar <zohar@linux.ibm.com> wrote:
> > On Mon, 2019-06-03 at 13:13 -0700, Matthew Garrett wrote:
> > > +                     template:= name or format of a defined IMA template
> > > +                     type (eg,ima-ng or d-ng|n-ng). Only valid when action
> > > +                     is "measure".
> >
> > This patch only supports specifying the template name, not the
> > template format description.  Please remove "d-ng|n-ng".
> 
> It supports specifying the template format, as long as the template
> format is already defined. I can remove the example, but it'll still
> work.

Correct, as mentioned in subsequent posts.  Until full support for
template field descriptions is added, please remove the field format
example.

> 
> > >       struct ima_rule_entry *entry;
> > >       int action = 0, actmask = flags | (flags << 1);
> > > @@ -438,6 +441,11 @@ int ima_match_policy(struct inode *inode, const struct cred *cred, u32 secid,
> > >               if ((pcr) && (entry->flags & IMA_PCR))
> > >                       *pcr = entry->pcr;
> > >
> > > +             if (template_desc && entry->template)
> > > +                     *template_desc = entry->template;
> > > +             else
> > > +                     *template_desc = ima_template_desc_current();
> > > +
> >
> > This code is finding the template format, but is subsequently being
> > replaced with the current description.  One way of fixing this, is by
> > initializing the template_desc before walking the list.
> 
> Ok

Subsequent posts pointed out that either all callers to
ima_match_policy() need to pass a pointer to template_desc or
*template_desc needs to be tested.

thanks!

Mimi
 


  reply	other threads:[~2019-06-04 20:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-03 20:13 [PATCH V3] IMA: Allow profiles to define the desired IMA template Matthew Garrett
2019-06-04  1:51 ` Mimi Zohar
2019-06-04 13:52   ` Mimi Zohar
2019-06-04 14:03   ` Roberto Sassu
2019-06-04 14:32     ` Mimi Zohar
2019-06-04 14:40       ` Roberto Sassu
2019-06-04 14:47         ` Mimi Zohar
2019-06-04 14:49           ` Roberto Sassu
2019-06-04 20:03   ` Matthew Garrett
2019-06-04 20:16     ` Mimi Zohar [this message]
2019-06-04 14:29 ` Roberto Sassu

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=1559679381.4237.9.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=bauerman@linux.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=mjg59@google.com \
    --cc=prsriva02@gmail.com \
    --cc=roberto.sassu@huawei.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.