lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 20 Jun 2017 10:52:48 -0500
From:   Tom Lendacky <thomas.lendacky@....com>
To:     Borislav Petkov <bp@...en8.de>
Cc:     linux-arch@...r.kernel.org, linux-efi@...r.kernel.org,
        kvm@...r.kernel.org, linux-doc@...r.kernel.org, x86@...nel.org,
        kexec@...ts.infradead.org, linux-kernel@...r.kernel.org,
        kasan-dev@...glegroups.com, xen-devel@...ts.xen.org,
        linux-mm@...ck.org, iommu@...ts.linux-foundation.org,
        Brijesh Singh <brijesh.singh@....com>,
        Toshimitsu Kani <toshi.kani@....com>,
        Radim Krčmář <rkrcmar@...hat.com>,
        Matt Fleming <matt@...eblueprint.co.uk>,
        Alexander Potapenko <glider@...gle.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Larry Woodman <lwoodman@...hat.com>,
        Jonathan Corbet <corbet@....net>,
        Joerg Roedel <joro@...tes.org>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Ingo Molnar <mingo@...hat.com>,
        Andrey Ryabinin <aryabinin@...tuozzo.com>,
        Dave Young <dyoung@...hat.com>, Rik van Riel <riel@...hat.com>,
        Arnd Bergmann <arnd@...db.de>,
        Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
        Andy Lutomirski <luto@...nel.org>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        Juergen Gross <jgross@...e.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: [PATCH v7 08/36] x86/mm: Add support to enable SME in early boot
 processing

On 6/20/2017 2:38 AM, Borislav Petkov wrote:
> On Fri, Jun 16, 2017 at 01:51:15PM -0500, Tom Lendacky wrote:
>> Add support to the early boot code to use Secure Memory Encryption (SME).
>> Since the kernel has been loaded into memory in a decrypted state, encrypt
>> the kernel in place and update the early pagetables with the memory
>> encryption mask so that new pagetable entries will use memory encryption.
>>
>> The routines to set the encryption mask and perform the encryption are
>> stub routines for now with functionality to be added in a later patch.
>>
>> Because of the need to have the routines available to head_64.S, the
>> mem_encrypt.c is always built and #ifdefs in mem_encrypt.c will provide
>> functionality or stub routines depending on CONFIG_AMD_MEM_ENCRYPT.
>>
>> Signed-off-by: Tom Lendacky <thomas.lendacky@....com>
>> ---
>>   arch/x86/include/asm/mem_encrypt.h |    8 +++++++
>>   arch/x86/kernel/head64.c           |   33 +++++++++++++++++++++---------
>>   arch/x86/kernel/head_64.S          |   39 ++++++++++++++++++++++++++++++++++--
>>   arch/x86/mm/Makefile               |    4 +---
>>   arch/x86/mm/mem_encrypt.c          |   24 ++++++++++++++++++++++
>>   5 files changed, 93 insertions(+), 15 deletions(-)
> 
> ...
> 
>> diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
>> index b99d469..9a78277 100644
>> --- a/arch/x86/mm/mem_encrypt.c
>> +++ b/arch/x86/mm/mem_encrypt.c
>> @@ -11,6 +11,9 @@
>>    */
>>   
>>   #include <linux/linkage.h>
>> +#include <linux/init.h>
>> +
>> +#ifdef CONFIG_AMD_MEM_ENCRYPT
>>   
>>   /*
>>    * Since SME related variables are set early in the boot process they must
>> @@ -19,3 +22,24 @@
>>    */
>>   unsigned long sme_me_mask __section(.data) = 0;
>>   EXPORT_SYMBOL_GPL(sme_me_mask);
>> +
>> +void __init sme_encrypt_kernel(void)
>> +{
>> +}
> 
> Just the minor:
> 
> void __init sme_encrypt_kernel(void) { }
> 
> in case you have to respin.

I have to re-spin for the kbuild test error.  But given that this
function will be filled in later it's probably not worth doing the
space savings here.

Thanks,
Tom

> 
> Reviewed-by: Borislav Petkov <bp@...e.de>
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ