Skip to contentSkip to conversation

ima: Fix warning: no previous prototype for function 'ima_add_kexec_buffer'

PATCH In review Lakshmi Ramasubramanian 3 participants 6 messages Jun 10, 2021 – Jun 11, 2021

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

PATCH 1/2 ima: Fix warning: no previous prototype for function 'ima_add_kexec_buffer'

The function prototype for ima_add_kexec_buffer() is present in 'linux/ima.h'. But this header file is not included in ima_kexec.c where the function is implemented. This results in the following compiler warning when "-Wmissing-prototypes" flag is turned on:

security/integrity/ima/ima_kexec.c:81:6: warning: no previous prototype for function 'ima_add_kexec_buffer' [-Wmissing-prototypes]

Include the header file 'linux/ima.h' in ima_kexec.c to fix the compiler warning.

Fixes dce92f6b11c3 (arm64: Enable passing IMA log to next kernel on kexec)
---
 security/integrity/ima/ima_kexec.c | 1 +
 1 file changed, 1 insertion(+)
security/integrity/ima/ima_kexec.c +1 -0
index 667887665823..f799cc278a9a 100644
@@ -11,6 +11,7 @@
 #include <linux/vmalloc.h>
 #include <linux/kexec.h>
 #include <linux/of.h>
+#include <linux/ima.h>
 #include "ima.h"
 
 #ifdef CONFIG_IMA_KEXEC
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 ima: Fix warning: no previous prototype for function 'ima_post_key_create_or_update'

The function prototype for ima_post_key_create_or_update() is present in 'linux/ima.h'. But this header file is not included in ima_asymmetric_keys.c where the function is implemented. This results in the following compiler warning when "-Wmissing-prototypes" flag is turned on:

security/integrity/ima/ima_asymmetric_keys.c:29:6: warning: no previous prototype for 'ima_post_key_create_or_update' [-Wmissing-prototypes]

Include the header file 'linux/ima.h' in ima_asymmetric_keys.c to fix the compiler warning.

Fixes 88e70da170e8 (IMA: Define an IMA hook to measure keys)
Cc stable(a)vger.kernel.org
---
 security/integrity/ima/ima_asymmetric_keys.c | 1 +
 1 file changed, 1 insertion(+)
security/integrity/ima/ima_asymmetric_keys.c +1 -0
index 1fb0b0e09559..c985418698a4 100644
@@ -11,6 +11,7 @@
 
 #include <keys/asymmetric-type.h>
 #include <linux/user_namespace.h>
+#include <linux/ima.h>
 #include "ima.h"
 
 /**
Signature · 1 line
2.25.1
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] ima: Fix warning: no previous prototype for function 'ima_post_key_create_or_update'

Quoted 13 lines · Lakshmi Ramasubramanian

The function prototype for ima_post_key_create_or_update() is present in 'linux/ima.h'. But this header file is not included in ima_asymmetric_keys.c where the function is implemented. This results in the following compiler warning when "-Wmissing-prototypes" flag is turned on:

security/integrity/ima/ima_asymmetric_keys.c:29:6: warning: no previous prototype for 'ima_post_key_create_or_update' [-Wmissing-prototypes]

Include the header file 'linux/ima.h' in ima_asymmetric_keys.c to fix the compiler warning.

Quoted 6 lines
Fixes 88e70da170e8 (IMA: Define an IMA hook to measure keys)
Cc stable(a)vger.kernel.org
---
 security/integrity/ima/ima_asymmetric_keys.c | 1 +
 1 file changed, 1 insertion(+)
maintainer
#3 lore raw

Re: [PATCH 2/2] ima: Fix warning: no previous prototype for function 'ima_post_key_create_or_update'

In reply to Lakshmi Ramasubramanian

Hi Lakshmi,

Quoted 9 lines · Lakshmi Ramasubramanian

The function prototype for ima_post_key_create_or_update() is present in 'linux/ima.h'. But this header file is not included in ima_asymmetric_keys.c where the function is implemented. This results in the following compiler warning when "-Wmissing-prototypes" flag is turned on:

security/integrity/ima/ima_asymmetric_keys.c:29:6: warning: no previous prototype for 'ima_post_key_create_or_update' [-Wmissing-prototypes]

Quoted 6 lines

Include the header file 'linux/ima.h' in ima_asymmetric_keys.c to fix the compiler warning.

Fixes 88e70da170e8 (IMA: Define an IMA hook to measure keys)
Cc stable(a)vger.kernel.org

Roberto posted an equivalent patch "[PATCH 4/5] ima: Include header defining ima_post_key_create_or_update()" earlier this week.

Compiler warnings don't meet the requirements for stable - Documentation/process/stable-kernel-rules.rst.

thanks,

Mimi

Acked-by on v1 1/2
#4 lore raw
In reply to Lakshmi Ramasubramanian
Quoted 13 lines · Lakshmi Ramasubramanian

The function prototype for ima_add_kexec_buffer() is present in 'linux/ima.h'. But this header file is not included in ima_kexec.c where the function is implemented. This results in the following compiler warning when "-Wmissing-prototypes" flag is turned on:

security/integrity/ima/ima_kexec.c:81:6: warning: no previous prototype for function 'ima_add_kexec_buffer' [-Wmissing-prototypes]

Include the header file 'linux/ima.h' in ima_kexec.c to fix the compiler warning.

Quoted 6 lines
Fixes dce92f6b11c3 (arm64: Enable passing IMA log to next kernel on kexec)
---
 security/integrity/ima/ima_kexec.c | 1 +
 1 file changed, 1 insertion(+)
maintainer
#5 lore raw
In reply to Lakshmi Ramasubramanian
Quoted 9 lines · Lakshmi Ramasubramanian

The function prototype for ima_add_kexec_buffer() is present in 'linux/ima.h'. But this header file is not included in ima_kexec.c where the function is implemented. This results in the following compiler warning when "-Wmissing-prototypes" flag is turned on:

security/integrity/ima/ima_kexec.c:81:6: warning: no previous prototype for function 'ima_add_kexec_buffer' [-Wmissing-prototypes]

Quoted 6 lines

Include the header file 'linux/ima.h' in ima_kexec.c to fix the compiler warning.

Fixes dce92f6b11c3 (arm64: Enable passing IMA log to next kernel on kexec)

Thanks!

Applied to: git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-
integrity.git next-integrity-testing and next-integrity branches.

Mimi