Skip to contentSkip to conversation

integrity: Fix __integrity_init_keyring() section mismatch

PATCH In review Geert Uytterhoeven 3 participants 3 messages Jun 17, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 integrity: Fix __integrity_init_keyring() section mismatch

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")
---
 security/integrity/digsig.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
security/integrity/digsig.c +3 -2
index 4582bc26770a34a7..868ade3e89702ba7 100644
@@ -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;
Signature · 1 line
2.17.1
Reviewed-by Nayna Jain on v1 1/1
#1 lore raw
Quoted 8 lines · 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.

Quoted 7 lines

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

Thanks for fixing it.

Thanks & Regards,
         - Nayna

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Geert Uytterhoeven
Quoted 8 lines · 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.

Quoted 7 lines

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")
Signature · 2 lines
James Morris
<[email protected]>