[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <CUOZ6XAVQ7DS.2UB3SEOKGXOBX@wks-101042-mac.ad.tuni.fi>
Date: Thu, 10 Aug 2023 18:38:39 +0300
From: "Jarkko Sakkinen" <jarkko@...nel.org>
To: "Nayna Jain" <nayna@...ux.ibm.com>,
<linux-integrity@...r.kernel.org>
Cc: "Mimi Zohar" <zohar@...ux.ibm.com>,
"Eric Snowberg" <eric.snowberg@...cle.com>,
"Paul Moore" <paul@...l-moore.com>,
"linuxppc-dev" <linuxppc-dev@...ts.ozlabs.org>,
<linux-security-module@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 3/6] integrity: remove global variable from
machine_keyring.c
On Wed Aug 9, 2023 at 10:53 PM EEST, Nayna Jain wrote:
> trust_mok variable is accessed within a single function locally.
>
> Change trust_mok from global to local static variable.
>
> Signed-off-by: Nayna Jain <nayna@...ux.ibm.com>
> Reviewed-and-tested-by: Mimi Zohar <zohar@...ux.ibm.com>
> ---
> security/integrity/platform_certs/machine_keyring.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/security/integrity/platform_certs/machine_keyring.c b/security/integrity/platform_certs/machine_keyring.c
> index 389a6e7c9245..9482e16cb2ca 100644
> --- a/security/integrity/platform_certs/machine_keyring.c
> +++ b/security/integrity/platform_certs/machine_keyring.c
> @@ -8,8 +8,6 @@
> #include <linux/efi.h>
> #include "../integrity.h"
>
> -static bool trust_mok;
> -
> static __init int machine_keyring_init(void)
> {
> int rc;
> @@ -65,9 +63,11 @@ static __init bool uefi_check_trust_mok_keys(void)
> bool __init trust_moklist(void)
> {
> static bool initialized;
> + static bool trust_mok;
>
> if (!initialized) {
> initialized = true;
> + trust_mok = false;
>
> if (uefi_check_trust_mok_keys())
> trust_mok = true;
Nice catch.
Reviewed-by: Jarkko Sakkinen <jarkko@...nel.org>
BR, Jarkko
Powered by blists - more mailing lists