Re: [PATCH] IMA: remove -Wmissing-prototypes warning

From: Mimi Zohar
Date: Tue Jun 29 2021 - 10:30:39 EST


[Cc: Petko Manolov <petkan@xxxxxxxxxxxx>]

Hi Austin,

On Tue, 2021-06-29 at 14:50 +0100, Austin Kim wrote:
> From: Austin Kim <austin.kim@xxxxxxx>
>
> With W=1 build, the compiler throws warning message as below:
>
> security/integrity/ima/ima_mok.c:24:12: warning:
> no previous prototype for ‘ima_mok_init’ [-Wmissing-prototypes]
> __init int ima_mok_init(void)
>
> Silence the warning by adding static keyword to ima_mok_init().
>
> Signed-off-by: Austin Kim <austin.kim@xxxxxxx>
> ---
> security/integrity/ima/ima_mok.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/security/integrity/ima/ima_mok.c b/security/integrity/ima/ima_mok.c
> index 1e5c01916173..95cc31525c57 100644
> --- a/security/integrity/ima/ima_mok.c
> +++ b/security/integrity/ima/ima_mok.c
> @@ -21,7 +21,7 @@ struct key *ima_blacklist_keyring;
> /*
> * Allocate the IMA blacklist keyring
> */
> -__init int ima_mok_init(void)
> +static __init int ima_mok_init(void)
> {
> struct key_restriction *restriction;
>

Thank you for the patch, which does fix the warning. The .ima_mok
keyring was removed a while ago. With all the recent work on the
system blacklist, I'm wondering if anyone is still using the IMA
blacklist keyring or whether it should be removed as well.

thanks,

Mimi