lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1383945800-12060-1-git-send-email-shuah.kh@samsung.com>
Date:	Fri,  8 Nov 2013 14:23:20 -0700
From:	Shuah Khan <shuah.kh@...sung.com>
To:	james.l.morris@...cle.com, zohar@...ux.vnet.ibm.com,
	d.kasatkin@...sung.com, dhowells@...hat.com
Cc:	Shuah Khan <shuah.kh@...sung.com>,
	linux-security-module@...r.kernel.org,
	linux-kernel@...r.kernel.org, shuahkhan@...il.com
Subject: [PATCH linux-next] security/integrity: Fix build error and warnings when CONFIG_INTEGRITY_ASYMMETRIC_KEYS is disabled

Fixed both linux-next build error and warnings with the following changes

- define integrity_init_keyring() only when CONFIG_INTEGRITY_ASYMMETRIC_KEYS
  is enabled
- move integrity_init_keyring() stub from integrity.h
- define integrity_init_keyring() prototype as an extern when
  CONFIG_INTEGRITY_ASYMMETRIC_KEYS

linux-next build fails with the following error when CONFIG_INTEGRITY_ASYMMETRIC_KEYS
is disabled.

  CC      security/integrity/digsig.o
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
make[1]: *** [security/integrity] Error 2
make: *** [security] Error 2

Signed-off-by: Shuah Khan <shuah.kh@...sung.com>
---
 security/integrity/digsig.c    | 7 +++++++
 security/integrity/integrity.h | 8 ++------
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/security/integrity/digsig.c b/security/integrity/digsig.c
index 77ca965..28bc1a7 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,9 @@ int integrity_init_keyring(const unsigned int id)
 			keyring_name[id], PTR_ERR(keyring[id]));
 	return 0;
 }
+#else
+int integrity_init_keyring(const unsigned int id)
+{
+	return 0;
+}
+#endif
diff --git a/security/integrity/integrity.h b/security/integrity/integrity.h
index b9e7c13..99ac783 100644
--- a/security/integrity/integrity.h
+++ b/security/integrity/integrity.h
@@ -134,22 +134,18 @@ static inline int integrity_digsig_verify(const unsigned int id,
 
 #endif /* CONFIG_INTEGRITY_SIGNATURE */
 
+extern int integrity_init_keyring(const unsigned int id);
+
 #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.3.2

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ