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]
Message-ID: <0522af41-59db-e621-69de-ad64dec3a5d6@intel.com>
Date:   Mon, 6 Dec 2021 13:45:13 -0800
From:   Reinette Chatre <reinette.chatre@...el.com>
To:     Jarkko Sakkinen <jarkko@...nel.org>
CC:     <dave.hansen@...ux.intel.com>, <tglx@...utronix.de>,
        <bp@...en8.de>, <luto@...nel.org>, <mingo@...hat.com>,
        <linux-sgx@...r.kernel.org>, <x86@...nel.org>, <seanjc@...gle.com>,
        <kai.huang@...el.com>, <cathy.zhang@...el.com>,
        <cedric.xing@...el.com>, <haitao.huang@...el.com>,
        <mark.shanahan@...el.com>, <hpa@...or.com>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 14/25] x86/sgx: Tighten accessible memory range after
 enclave initialization

Hi Jarkko,

On 12/4/2021 3:14 PM, Jarkko Sakkinen wrote:
>> diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c
>> index 342b97dd4c33..37203da382f8 100644
>> --- a/arch/x86/kernel/cpu/sgx/encl.c
>> +++ b/arch/x86/kernel/cpu/sgx/encl.c
>> @@ -403,6 +403,10 @@ int sgx_encl_may_map(struct sgx_encl *encl, unsigned long start,
>>   
>>   	XA_STATE(xas, &encl->page_array, PFN_DOWN(start));
>>   
> 
> Please write a comment here.

Would the comment below suffice?

/* Disallow mapping outside enclave's address range. */

> 
>> +	if (test_bit(SGX_ENCL_INITIALIZED, &encl->flags) &&
>> +	    (start < encl->base || end > encl->base + encl->size))
>> +		return -EACCES;
>> +
>>   	/*
>>   	 * Disallow READ_IMPLIES_EXEC tasks as their VMA permissions might
>>   	 * conflict with the enclave page permissions.
>> -- 
>> 2.25.1
>>
> 
> Otherwise, makes sense.
> 

Thank you

Reinette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ