[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YXtlnORs1545GXvq@iki.fi>
Date: Fri, 29 Oct 2021 06:08:12 +0300
From: Jarkko Sakkinen <jarkko@...nel.org>
To: Reinette Chatre <reinette.chatre@...el.com>
Cc: linux-sgx@...r.kernel.org, shuah@...nel.org,
dave.hansen@...ux.intel.com, seanjc@...gle.com,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2 13/15] selftests/sgx: Add page permission and
exception test
On Thu, Oct 28, 2021 at 01:37:38PM -0700, Reinette Chatre wrote:
> The Enclave Page Cache Map (EPCM) is a secure structure used by the
> processor to track the contents of the enclave page cache. The EPCM
> contains permissions with which enclave pages can be accessed. SGX
> support allows EPCM and PTE page permissions to differ - as long as
> the PTE permissions do not exceed the EPCM permissions.
>
> Add a test that:
> (1) Creates an SGX enclave page with writable EPCM permission.
> (2) Changes the PTE permission on the page to read-only. This should
> be permitted because the permission does not exceed the EPCM
> permission.
> (3) Attempts a write to the page. This should generate a page fault
> (#PF) because of the read-only PTE even though the EPCM
> permissions allow the page to be written to.
>
> This introduces the first test of SGX exception handling. In this test
> the issue that caused the exception (PTE page permissions) can be fixed
> from outside the enclave and after doing so it is possible to re-enter
> enclave at original entrypoint with ERESUME.
>
> Acked-by: Dave Hansen <dave.hansen@...ux.intel.com>
> Signed-off-by: Reinette Chatre <reinette.chatre@...el.com>
Reviewed-by: Jarkko Sakkinen <jarkko@...nel.org>
/Jarkko
Powered by blists - more mailing lists