Linux Integrity Measurement development
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Nayna Jain <nayna@linux.ibm.com>,
	linux-integrity@vger.kernel.org, keyrings@vger.kernel.org
Cc: linux-security-module@vger.kernel.org,
	David Howells <dhowells@redhat.com>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	Stefan Berger <stefanb@linux.ibm.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Mimi Zohar <zohar@linux.ibm.com>, Arnd Bergmann <arnd@kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH] ima: ensure IMA_APPRAISE_MODSIG has necessary dependencies
Date: Thu, 22 Apr 2021 19:57:37 -0700	[thread overview]
Message-ID: <24feb895-eae1-5b9e-47d8-9ee9851710cc@infradead.org> (raw)
In-Reply-To: <20210423011602.138946-1-nayna@linux.ibm.com>

On 4/22/21 6:16 PM, Nayna Jain wrote:
> IMA_APPRAISE_MODSIG is used for verifying the integrity of both kernel
> and modules. Enabling IMA_APPRAISE_MODSIG without MODULES causes a build
> break.
> 
> Ensure the build time kernel signing key is only generated if both
> IMA_APPRAISE_MODSIG and MODULES are enabled.
> 
> Fixes: 0165f4ca223b ("ima: enable signing of modules with build time generated key") 
> Reported-by: Randy Dunlap <rdunlap@infradead.org> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Nayna Jain <nayna@linux.ibm.com>

Works For Me. Thanks.

Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested

> ---
>  certs/Kconfig               | 2 +-
>  certs/Makefile              | 2 ++
>  certs/system_certificates.S | 3 ++-
>  3 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/certs/Kconfig b/certs/Kconfig
> index 48675ad319db..e4d00348fd73 100644
> --- a/certs/Kconfig
> +++ b/certs/Kconfig
> @@ -4,7 +4,7 @@ menu "Certificates for signature checking"
>  config MODULE_SIG_KEY
>  	string "File name or PKCS#11 URI of module signing key"
>  	default "certs/signing_key.pem"
> -	depends on MODULE_SIG || IMA_APPRAISE_MODSIG
> +	depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)
>  	help
>           Provide the file name of a private key/certificate in PEM format,
>           or a PKCS#11 URI according to RFC7512. The file should contain, or
> diff --git a/certs/Makefile b/certs/Makefile
> index e3185c57fbd8..2f369d6aa494 100644
> --- a/certs/Makefile
> +++ b/certs/Makefile
> @@ -36,8 +36,10 @@ ifeq ($(CONFIG_MODULE_SIG),y)
>  endif
>  
>  ifeq ($(CONFIG_IMA_APPRAISE_MODSIG),y)
> +ifeq ($(CONFIG_MODULES),y)
>  	SIGN_KEY = y
>  endif
> +endif
>  
>  ifdef SIGN_KEY
>  ###############################################################################
> diff --git a/certs/system_certificates.S b/certs/system_certificates.S
> index dcad27ea8527..e1645e6f4d97 100644
> --- a/certs/system_certificates.S
> +++ b/certs/system_certificates.S
> @@ -9,7 +9,8 @@
>  system_certificate_list:
>  __cert_list_start:
>  __module_cert_start:
> -#if defined(CONFIG_MODULE_SIG) || defined(CONFIG_IMA_APPRAISE_MODSIG)
> +#if defined(CONFIG_MODULE_SIG) || (defined(CONFIG_IMA_APPRAISE_MODSIG) \
> +			       && defined(CONFIG_MODULES))
>  	.incbin "certs/signing_key.x509"
>  #endif
>  __module_cert_end:
> 


-- 
~Randy


      reply	other threads:[~2021-04-23  2:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23  1:16 [PATCH] ima: ensure IMA_APPRAISE_MODSIG has necessary dependencies Nayna Jain
2021-04-23  2:57 ` Randy Dunlap [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=24feb895-eae1-5b9e-47d8-9ee9851710cc@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=arnd@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=nayna@linux.ibm.com \
    --cc=sfr@canb.auug.org.au \
    --cc=stefanb@linux.ibm.com \
    --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