linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bruno Meneguele <bmeneg@redhat.com>
To: Nayna <nayna@linux.vnet.ibm.com>
Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
	zohar@linux.ibm.com, erichte@linux.ibm.com, nayna@linux.ibm.com,
	stable@vger.kernel.org
Subject: Re: [PATCH v4] ima: move APPRAISE_BOOTPARAM dependency on ARCH_POLICY to runtime
Date: Wed, 8 Jul 2020 10:39:41 -0300	[thread overview]
Message-ID: <20200708133941.GA2651@glitch> (raw)
In-Reply-To: <91a81761-1490-7250-8245-4d78d190385f@linux.vnet.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 2368 bytes --]

On Tue, Jul 07, 2020 at 07:56:37PM -0400, Nayna wrote:
> 
> On 7/3/20 2:00 PM, Bruno Meneguele wrote:
> > APPRAISE_BOOTPARAM has been marked as dependent on !ARCH_POLICY in compile
> > time, enforcing the appraisal whenever the kernel had the arch policy option
> > enabled.
> > 
> > However it breaks systems where the option is set but the system wasn't
> > booted in a "secure boot" platform. In this scenario, anytime an appraisal
> > policy (i.e. ima_policy=appraisal_tcb) is used it will be forced, giving no
> > chance to the user set the 'fix' state (ima_appraise=fix) to actually
> > measure system's files.
> 
> "measure" is incorrect. It is appraisal.
> 

Yes, of course, sorry.

> How about changing the statement to "without giving the user the opportunity
> to label the filesystem, before enforcing integrity." ?
> 

Ack.
That's better :)

> > diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c
> > index a9649b04b9f1..4fc83b3fbd5c 100644
> > --- a/security/integrity/ima/ima_appraise.c
> > +++ b/security/integrity/ima/ima_appraise.c
> > @@ -18,14 +18,16 @@
> >   static int __init default_appraise_setup(char *str)
> >   {
> > -#ifdef CONFIG_IMA_APPRAISE_BOOTPARAM
> > -	if (strncmp(str, "off", 3) == 0)
> > -		ima_appraise = 0;
> > -	else if (strncmp(str, "log", 3) == 0)
> > -		ima_appraise = IMA_APPRAISE_LOG;
> > -	else if (strncmp(str, "fix", 3) == 0)
> > -		ima_appraise = IMA_APPRAISE_FIX;
> > -#endif
> > +	if (IS_ENABLED(CONFIG_IMA_APPRAISE_BOOTPARAM) &&
> > +	    !arch_ima_get_secureboot()) {
> > +		if (strncmp(str, "off", 3) == 0)
> > +			ima_appraise = 0;
> > +		else if (strncmp(str, "log", 3) == 0)
> > +			ima_appraise = IMA_APPRAISE_LOG;
> > +		else if (strncmp(str, "fix", 3) == 0)
> > +			ima_appraise = IMA_APPRAISE_FIX;
> > +	}
> > +
> >   	return 1;
> >   }
> 
> If secureboot is enabled, it is silently ignoring the boot parameters. It
> would be helpful if there is a log message notifying user about that.
> 
> Can you please Cc powerpc, s390, and x86 mailing list and maintainers, when
> you post the next version ?
> 
> I would try to test it sometime in this week.
> 

Sure. I'm preparing a new version and will post soon.

> Thanks & Regards,
> 

Thank you.

-- 
bmeneg 
PGP Key: http://bmeneg.com/pubkey.txt

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      parent reply	other threads:[~2020-07-08 13:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03 18:00 [PATCH v4] ima: move APPRAISE_BOOTPARAM dependency on ARCH_POLICY to runtime Bruno Meneguele
     [not found] ` <91a81761-1490-7250-8245-4d78d190385f@linux.vnet.ibm.com>
2020-07-08 13:39   ` Bruno Meneguele [this message]

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=20200708133941.GA2651@glitch \
    --to=bmeneg@redhat.com \
    --cc=erichte@linux.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nayna@linux.ibm.com \
    --cc=nayna@linux.vnet.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=zohar@linux.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).