linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] integrity: Fix __integrity_init_keyring() section mismatch
@ 2019-06-17  7:44 Geert Uytterhoeven
  2019-06-17 14:04 ` Nayna
  2019-06-17 18:11 ` James Morris
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2019-06-17  7:44 UTC (permalink / raw)
  To: Nayna Jain, Mimi Zohar, James Morris, Serge E . Hallyn
  Cc: linux-security-module, linux-kernel, Geert Uytterhoeven

With gcc-4.6.3:

    WARNING: vmlinux.o(.text.unlikely+0x24c64): Section mismatch in reference from the function __integrity_init_keyring() to the function .init.text:set_platform_trusted_keys()
    The function __integrity_init_keyring() references
    the function __init set_platform_trusted_keys().
    This is often because __integrity_init_keyring lacks a __init
    annotation or the annotation of set_platform_trusted_keys is wrong.

Indeed, if the compiler decides not to inline __integrity_init_keyring(),
a warning is issued.

Fix this by adding the missing __init annotation.

Fixes: 9dc92c45177ab70e ("integrity: Define a trusted platform keyring")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 security/integrity/digsig.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/security/integrity/digsig.c b/security/integrity/digsig.c
index 4582bc26770a34a7..868ade3e89702ba7 100644
--- a/security/integrity/digsig.c
+++ b/security/integrity/digsig.c
@@ -69,8 +69,9 @@ int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen,
 	return -EOPNOTSUPP;
 }
 
-static int __integrity_init_keyring(const unsigned int id, key_perm_t perm,
-				    struct key_restriction *restriction)
+static int __init __integrity_init_keyring(const unsigned int id,
+					   key_perm_t perm,
+					   struct key_restriction *restriction)
 {
 	const struct cred *cred = current_cred();
 	int err = 0;
-- 
2.17.1


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

end of thread, other threads:[~2019-06-17 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-17  7:44 [PATCH] integrity: Fix __integrity_init_keyring() section mismatch Geert Uytterhoeven
2019-06-17 14:04 ` Nayna
2019-06-17 18:11 ` James Morris

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