]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.1/integrity-fix-__integrity_init_keyring-section-misma.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / queue-5.1 / integrity-fix-__integrity_init_keyring-section-misma.patch
1 From cba3212bf4993d6a45e64c53e7108e3c131bdb8c Mon Sep 17 00:00:00 2001
2 From: Geert Uytterhoeven <geert@linux-m68k.org>
3 Date: Mon, 17 Jun 2019 09:44:52 +0200
4 Subject: integrity: Fix __integrity_init_keyring() section mismatch
5
6 [ Upstream commit 8c655784e2cf59cb6140759b8b546d98261d1ad9 ]
7
8 With gcc-4.6.3:
9
10 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()
11 The function __integrity_init_keyring() references
12 the function __init set_platform_trusted_keys().
13 This is often because __integrity_init_keyring lacks a __init
14 annotation or the annotation of set_platform_trusted_keys is wrong.
15
16 Indeed, if the compiler decides not to inline __integrity_init_keyring(),
17 a warning is issued.
18
19 Fix this by adding the missing __init annotation.
20
21 Fixes: 9dc92c45177ab70e ("integrity: Define a trusted platform keyring")
22 Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
23 Reviewed-by: Nayna Jain <nayna@linux.ibm.com>
24 Reviewed-by: James Morris <jamorris@linux.microsoft.com>
25 Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
26 Signed-off-by: Sasha Levin <sashal@kernel.org>
27 ---
28 security/integrity/digsig.c | 5 +++--
29 1 file changed, 3 insertions(+), 2 deletions(-)
30
31 diff --git a/security/integrity/digsig.c b/security/integrity/digsig.c
32 index e19c2eb72c51..37869214c243 100644
33 --- a/security/integrity/digsig.c
34 +++ b/security/integrity/digsig.c
35 @@ -73,8 +73,9 @@ int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen,
36 return -EOPNOTSUPP;
37 }
38
39 -static int __integrity_init_keyring(const unsigned int id, key_perm_t perm,
40 - struct key_restriction *restriction)
41 +static int __init __integrity_init_keyring(const unsigned int id,
42 + key_perm_t perm,
43 + struct key_restriction *restriction)
44 {
45 const struct cred *cred = current_cred();
46 int err = 0;
47 --
48 2.20.1
49