diff mbox series

integrity: Fix __integrity_init_keyring() section mismatch

Message ID 20190617074452.12901-1-geert@linux-m68k.org (mailing list archive)
State New, archived
Headers show
Series integrity: Fix __integrity_init_keyring() section mismatch | expand

Commit Message

Geert Uytterhoeven June 17, 2019, 7:44 a.m. UTC
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(-)

Comments

Nayna June 17, 2019, 2:04 p.m. UTC | #1
On 06/17/2019 03:44 AM, Geert Uytterhoeven wrote:
> 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>

Thanks for fixing it.

Reviewed-by: Nayna Jain <nayna@linux.ibm.com>

Thanks & Regards,
          - Nayna
James Morris June 17, 2019, 6:11 p.m. UTC | #2
On Mon, 17 Jun 2019, Geert Uytterhoeven wrote:

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


Reviewed-by: James Morris <jamorris@linux.microsoft.com>
diff mbox series

Patch

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;