diff mbox series

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

Message ID 20210610171553.3806-2-nramas@linux.microsoft.com (mailing list archive)
State New, archived
Headers show
Series [1/2] ima: Fix warning: no previous prototype for function 'ima_add_kexec_buffer' | expand

Commit Message

Lakshmi Ramasubramanian June 10, 2021, 5:15 p.m. UTC
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@vger.kernel.org
Signed-off-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
---
 security/integrity/ima/ima_asymmetric_keys.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Rob Herring June 10, 2021, 5:36 p.m. UTC | #1
On Thu, Jun 10, 2021 at 12:16 PM Lakshmi Ramasubramanian
<nramas@linux.microsoft.com> wrote:
>
> 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@vger.kernel.org
> Signed-off-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
> ---
>  security/integrity/ima/ima_asymmetric_keys.c | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Rob Herring <robh@kernel.org>
Mimi Zohar June 11, 2021, 1:24 a.m. UTC | #2
Hi Lakshmi,

On Thu, 2021-06-10 at 10:15 -0700, Lakshmi Ramasubramanian wrote:
> 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@vger.kernel.org
> Signed-off-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>

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
diff mbox series

Patch

diff --git a/security/integrity/ima/ima_asymmetric_keys.c b/security/integrity/ima/ima_asymmetric_keys.c
index 1fb0b0e09559..c985418698a4 100644
--- a/security/integrity/ima/ima_asymmetric_keys.c
+++ b/security/integrity/ima/ima_asymmetric_keys.c
@@ -11,6 +11,7 @@ 
 
 #include <keys/asymmetric-type.h>
 #include <linux/user_namespace.h>
+#include <linux/ima.h>
 #include "ima.h"
 
 /**