[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <763bddd2-2fc3-a857-0dff-a5ae4ae1f298@intel.com>
Date: Wed, 24 Aug 2022 15:20:59 -0700
From: "Chang S. Bae" <chang.seok.bae@...el.com>
To: Evan Green <evgreen@...omium.org>
CC: <linux-crypto@...r.kernel.org>, <dm-devel@...hat.com>,
<herbert@...dor.apana.org.au>, Eric Biggers <ebiggers@...nel.org>,
"Ard Biesheuvel" <ardb@...nel.org>, <x86@...nel.org>,
<luto@...nel.org>, "Thomas Gleixner" <tglx@...utronix.de>,
<bp@...e.de>, <dave.hansen@...ux.intel.com>, <mingo@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Dan Williams <dan.j.williams@...el.com>,
<charishma1.gairuboyina@...el.com>,
<kumar.n.dwarakanath@...el.com>, <ravi.v.shankar@...el.com>
Subject: Re: [PATCH v5 07/12] x86/cpu/keylocker: Load an internal wrapping key
at boot-time
On 8/23/2022 8:49 AM, Evan Green wrote:
> On Wed, Jan 12, 2022 at 1:21 PM Chang S. Bae <chang.seok.bae@...el.com> wrote:
>>
<snip>
>> +
>> +static void __init load_keylocker(void)
>
> I am late to this party by 6 months, but:
> load_keylocker() cannot be __init, as it gets called during SMP core onlining.
Yeah, it looks like the case with this patch only.
But the next patch [1] limits the call during boot time only:
if (c == &boot_cpu_data) {
...
load_keylocker();
...
} else {
...
if (!kl_setup.initialized) {
load_keylocker();
} else if (valid_kl) {
rc = copy_keylocker();
...
}
}
kl_setup.initialized is set by native_smp_cpus_done() ->
destroy_keylocker_data() when CPUs are booted. Then load_keylocker() is
not called because the root key (aka IWKey) is no longer available in
memory.
Now this 'valid_kl' flag should be always on unless the root key backup
is corrupted. Then copy_keylocker() loads the root key from the backup
in the platform state.
So I think the onlining CPU won't call it.
Maybe this bit can be much clarified in a separate (new) patch, instead
of being part of another like [1].
Thanks,
Chang
[1]:
https://lore.kernel.org/lkml/20220112211258.21115-9-chang.seok.bae@intel.com/
Powered by blists - more mailing lists