lkml.org 
[lkml]   [2022]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v9 42/43] virt: sevguest: Add support to derive key
From


On 07/02/2022 18:23, Brijesh Singh wrote:
>
>
> On 2/7/22 2:52 AM, Borislav Petkov wrote:
>> Those are allocated on stack, why are you clearing them?
>
> Yep, no need to explicitly clear it. I'll take it out in next rev.
>

Wait, this is key material generated by PSP and passed to userspace.
Why leave copies of it floating around kernel memory? I thought that's
the whole reason for these memzero_explicit() calls (maybe add a comment?).

As an example, in arch/x86/crypto/aesni-intel_glue.c there are two calls
to memzero_explicit(), both on stack variables; the only reason for
these calls (as I understand it) is to avoid some future possible leak
of this sensitive data (keys, cipher context, etc.). I'm sure there are
other examples in the kernel code.


-Dov

\
 
 \ /
  Last update: 2022-02-07 20:18    [W:0.091 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site