Linux Integrity Measurement development
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>,
	kbuild test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org, linux-integrity@vger.kernel.org,
	Mimi Zohar <zohar@linux.ibm.com>
Subject: Re: [integrity:next-integrity-testing 5/5] security/integrity/ima/ima_asymmetric_keys.c:53:6: error: redefinition of 'ima_init_key_queue'
Date: Sun, 05 Jan 2020 10:15:15 -0800	[thread overview]
Message-ID: <1578248115.3310.41.camel@HansenPartnership.com> (raw)
In-Reply-To: <48389231-dfcf-be6d-b543-6da8e3d55886@linux.microsoft.com>

On Sun, 2020-01-05 at 09:57 -0800, Lakshmi Ramasubramanian wrote:
> On 1/5/2020 1:00 AM, kbuild test robot wrote:
> 
> > 
> > > > security/integrity/ima/ima_asymmetric_keys.c:53:6: error:
> > > > redefinition of 'ima_init_key_queue'
> > 
> >      void ima_init_key_queue(void)
> >           ^~~~~~~~~~~~~~~~~~
> >     In file included from
> > security/integrity/ima/ima_asymmetric_keys.c:16:0:
> >     security/integrity/ima/ima.h:222:20: note: previous definition
> > of 'ima_init_key_queue' was here
> >      static inline void ima_init_key_queue(void) {}
> 
> In the given config file the following configs are specified
> 
> 	CONFIG_IMA=y
> 	CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m
> 
> If CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE is selected 
> ima_asymmetric_keys.c file is built and linked (as given in the 
> Makefile). ima_init_key_queue() is declared in ima.h
> 
> But if CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE is not selected 
> ima_asymmetric_keys.c is not built. ima_init_key_queue() is declared
> as an empty function (static inline in ima.h)
> 
> #ifdef CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE
> void ima_init_key_queue(void);
> #else
> static inline void ima_init_key_queue(void) {}
> #endif /* CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE */
> 
> If I understand the reported build error, it looks like 
> CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE was disabled first and then
> enabled later - in the same build sequence.
> 
> Is that correct?

I don't think so.  The specific problem is that
ASYMMETRIC_PUBLIC_KEY_SUBTYPE is defined as a tristate in
crypto/asymmetric_keys/Kconfig, so the above m setting for it is
perfectly legal regardless of the IMA setting.  This line you
introduced to the Makefile:

obj-$(CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE) += ima_asymmetric_keys.o

Then causes ima_asymmetric_keys.o to be added to obj-m causing the
kernel to think it's building it as a module.

To fix this, I think you have to force ASYMMETRIC_PUBLIC_KEY_SUBTYPE to
be built in if IMA is.

James


  reply	other threads:[~2020-01-05 18:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-05  9:00 [integrity:next-integrity-testing 5/5] security/integrity/ima/ima_asymmetric_keys.c:53:6: error: redefinition of 'ima_init_key_queue' kbuild test robot
2020-01-05 17:57 ` Lakshmi Ramasubramanian
2020-01-05 18:15   ` James Bottomley [this message]
2020-01-05 18:56     ` Lakshmi Ramasubramanian
2020-01-05 19:16       ` James Bottomley
2020-01-06  3:58         ` Lakshmi Ramasubramanian
2020-01-06 13:23           ` Mimi Zohar
2020-01-06 14:58           ` James Bottomley

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=1578248115.3310.41.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=nramas@linux.microsoft.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