Re: randconfig build error with next-20131104, in security/integrity

From: Mimi Zohar
Date: Mon Nov 04 2013 - 18:14:31 EST


On Mon, 2013-11-04 at 11:29 -0700, Jim Davis wrote:
> Building with the attached random configuration file,
>
> security/integrity/digsig.c:70:5: error: redefinition of âintegrity_init_keyring
> â
> int integrity_init_keyring(const unsigned int id)
> ^
> In file included from security/integrity/digsig.c:22:0:
> security/integrity/integrity.h:149:12: note: previous definition of
> âintegrity_init_keyringâ was here
> static int integrity_init_keyring(const unsigned int id)
> ^
> security/integrity/integrity.h:149:12: warning:
> âintegrity_init_keyringâ defined but not used [-Wunused-function]
> make[2]: *** [security/integrity/digsig.o] Error 1

Thanks! The following patch should resolve these errors.

Subject: [PATCH] ima: fix random config build error

Define stub integrity_init_keyring() definition based on
CONFIG_INTEGRITY_SIGNATURE, not CONFIG_INTEGRITY_ASYMMETRIC_KEYS.

Reported-by: Jim Davis <jim.epost@xxxxxxxxx>
Signed-off-by: Mimi Zohar <zohar@xxxxxxxxxxxxxxxxxx>
---
security/integrity/integrity.h | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/security/integrity/integrity.h b/security/integrity/integrity.h
index b9e7c13..a3c678c 100644
--- a/security/integrity/integrity.h
+++ b/security/integrity/integrity.h
@@ -123,6 +123,7 @@ struct integrity_iint_cache *integrity_iint_find(struct inode *inode);
int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen,
const char *digest, int digestlen);

+int integrity_init_keyring(const unsigned int id);
#else

static inline int integrity_digsig_verify(const unsigned int id,
@@ -132,24 +133,22 @@ static inline int integrity_digsig_verify(const unsigned int id,
return -EOPNOTSUPP;
}

+static int integrity_init_keyring(const unsigned int id)
+{
+ return 0;
+}
#endif /* CONFIG_INTEGRITY_SIGNATURE */

#ifdef CONFIG_INTEGRITY_ASYMMETRIC_KEYS
int asymmetric_verify(struct key *keyring, const char *sig,
int siglen, const char *data, int datalen);

-int integrity_init_keyring(const unsigned int id);
#else
static inline int asymmetric_verify(struct key *keyring, const char *sig,
int siglen, const char *data, int datalen)
{
return -EOPNOTSUPP;
}
-
-static int integrity_init_keyring(const unsigned int id)
-{
- return 0;
-}
#endif

#ifdef CONFIG_INTEGRITY_AUDIT
--
1.8.1.4



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/