linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ima: Fix build failure of redefinition of integrity_init_keyring()
@ 2013-11-26 20:04 Steven Rostedt
  2013-11-26 20:12 ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2013-11-26 20:04 UTC (permalink / raw)
  To: LKML
  Cc: Mimi Zohar, Dmitry Kasatkin, Andrew Morton, Linus Torvalds, James Morris

If CONFIG_INTEGRITY_SIGNATURE is set, but
CONFIG_INTEGRITY_ASYMMETRIC_KEYS is not, then we get the following
build failure:

linux.git/security/integrity/digsig.c:70:5: error: redefinition of ‘integrity_init_keyring’
linux.git/security/integrity/integrity.h:149:12: note: previous definition of ‘integrity_init_keyring’ was here
linux.git/security/integrity/integrity.h:149:12: warning: ‘integrity_init_keyring’ defined but not used distcc[8580] ERROR:
compile /home/rostedt/work/git/linux-trace.git/security/integrity/digsig.c on localhost failed

The problem is that CONFIG_INTEGRITY_SIGNATURE will compile digsig.o,
which defines integrity_init_keyring(), but when
CONFIG_INTEGRITY_ASYMMETRIC_KEYS is not defined, the header will define
integrity_init_keyring() as a static inline.

Do not define integrity_init_keyring() when
CONFIG_INTEGRITY_ASYMMETRIC_KEYS is not configured.

I also added the missing "inline" for the stub function.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

diff --git a/security/integrity/digsig.c b/security/integrity/digsig.c
index 77ca965..00bc3e1 100644
--- a/security/integrity/digsig.c
+++ b/security/integrity/digsig.c
@@ -67,6 +67,7 @@ int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen,
 	return -EOPNOTSUPP;
 }
 
+#ifdef CONFIG_INTEGRITY_ASYMMETRIC_KEYS
 int integrity_init_keyring(const unsigned int id)
 {
 	const struct cred *cred = current_cred();
@@ -84,3 +85,4 @@ int integrity_init_keyring(const unsigned int id)
 			keyring_name[id], PTR_ERR(keyring[id]));
 	return 0;
 }
+#endif
diff --git a/security/integrity/integrity.h b/security/integrity/integrity.h
index b9e7c13..c3d48dc 100644
--- a/security/integrity/integrity.h
+++ b/security/integrity/integrity.h
@@ -146,7 +146,7 @@ static inline int asymmetric_verify(struct key *keyring, const char *sig,
 	return -EOPNOTSUPP;
 }
 
-static int integrity_init_keyring(const unsigned int id)
+static inline int integrity_init_keyring(const unsigned int id)
 {
 	return 0;
 }

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ima: Fix build failure of redefinition of integrity_init_keyring()
  2013-11-26 20:04 [PATCH] ima: Fix build failure of redefinition of integrity_init_keyring() Steven Rostedt
@ 2013-11-26 20:12 ` Linus Torvalds
  2013-11-26 20:23   ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 2013-11-26 20:12 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Mimi Zohar, Dmitry Kasatkin, Andrew Morton, James Morris

On Tue, Nov 26, 2013 at 12:04 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> If CONFIG_INTEGRITY_SIGNATURE is set, but
> CONFIG_INTEGRITY_ASYMMETRIC_KEYS is not, then we get the following
> build failure:

Didn't this already get fixed by the reverts I did and Mimi acked?

Commits 4c1cc40a2d49 ("Revert "KEYS: verify a certificate is signed by
a 'trusted' key"") and 34ef7bd3823b ("Revert "ima: define '_ima' as a
builtin 'trusted' keyring"") to be exact.

              Linus

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ima: Fix build failure of redefinition of integrity_init_keyring()
  2013-11-26 20:12 ` Linus Torvalds
@ 2013-11-26 20:23   ` Steven Rostedt
  0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2013-11-26 20:23 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: LKML, Mimi Zohar, Dmitry Kasatkin, Andrew Morton, James Morris

On Tue, 26 Nov 2013 12:12:12 -0800
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Tue, Nov 26, 2013 at 12:04 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> > If CONFIG_INTEGRITY_SIGNATURE is set, but
> > CONFIG_INTEGRITY_ASYMMETRIC_KEYS is not, then we get the following
> > build failure:
> 
> Didn't this already get fixed by the reverts I did and Mimi acked?
> 
> Commits 4c1cc40a2d49 ("Revert "KEYS: verify a certificate is signed by
> a 'trusted' key"") and 34ef7bd3823b ("Revert "ima: define '_ima' as a
> builtin 'trusted' keyring"") to be exact.
> 

Ah, your right. I was working against 3.13-rc1, that revert came later.

OK, please ignore.

I'll add those reverts to my tests for my branches that are still based
on 3.13-rc1.

Thanks!

-- Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-26 20:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-26 20:04 [PATCH] ima: Fix build failure of redefinition of integrity_init_keyring() Steven Rostedt
2013-11-26 20:12 ` Linus Torvalds
2013-11-26 20:23   ` Steven Rostedt

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).