[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <90ce2028-dfdb-9b9a-24a6-9f9210cedbcb@intel.com>
Date: Mon, 8 May 2023 11:18:14 -0700
From: "Chang S. Bae" <chang.seok.bae@...el.com>
To: Eric Biggers <ebiggers@...nel.org>
CC: <linux-kernel@...r.kernel.org>, <linux-crypto@...r.kernel.org>,
<dm-devel@...hat.com>, <gmazyland@...il.com>, <luto@...nel.org>,
<dave.hansen@...ux.intel.com>, <tglx@...utronix.de>, <bp@...e.de>,
<mingo@...nel.org>, <x86@...nel.org>,
<herbert@...dor.apana.org.au>, <ardb@...nel.org>,
<dan.j.williams@...el.com>, <bernie.keany@...el.com>,
<charishma1.gairuboyina@...el.com>,
<lalithambika.krishnakumar@...el.com>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
"Rafael J. Wysocki" <rafael@...nel.org>, <linux-pm@...r.kernel.org>
Subject: Re: [PATCH v6 08/12] x86/PM/keylocker: Restore internal wrapping key
on resume from ACPI S3/4
On 5/5/2023 4:09 PM, Eric Biggers wrote:
> On Mon, Apr 10, 2023 at 03:59:32PM -0700, Chang S. Bae wrote:
>> +/*
>> + * This flag is set with IWKey load. When the key restore fails, it is
>> + * reset. This restore state is exported to the crypto library, then AES-KL
>> + * will not be used there. So, the feature is soft-disabled with this flag.
>> + */
>> +static bool valid_kl;
>> +
>> +bool valid_keylocker(void)
>> +{
>> + return valid_kl;
>> +}
>> +EXPORT_SYMBOL_GPL(valid_keylocker);
>
> It would be simpler to export this bool directly.
Yeah, but this wrapper is for code encapsulation. The code outside of
the core code is not allowed to overwrite the value.
Perhaps, it is better to export it only with the AES-KL module:
#if IS_MODULE(CONFIG_CRYPTO_AES_KL)
EXPORT_SYMBOL_GPL(valid_keylocker);
#endif
>> + if (status & BIT(0))
>> + return 0;
>> + else
>> + return -EBUSY;
> [...]
>> + pr_info("x86/keylocker: Enabled.\n");
>> + return;
>> + } else {
>> + int rc;
>
> The kernel coding style usually doesn't use 'else' after a return.
Yeah, right. Will fix up.
Thanks,
Chang
Powered by blists - more mailing lists