Re: [PATCH v38 17/24] x86/sgx: ptrace() support for the SGX driver

From: Jarkko Sakkinen
Date: Wed Sep 23 2020 - 09:21:07 EST


On Tue, Sep 22, 2020 at 05:44:24PM +0200, Borislav Petkov wrote:
>
> > Subject: Re: [PATCH v38 17/24] x86/sgx: ptrace() support for the SGX driver
> ... x86/sgx: Add ptrace() support...
>
> subject needs a verb.
>
> On Tue, Sep 15, 2020 at 02:28:35PM +0300, Jarkko Sakkinen wrote:
> > Add VMA callbacks for ptrace() that can be used with debug enclaves.
> > With debug enclaves data can be read and write the memory word at a time
>
> I think you wanna say here
>
> "... data can be read and/or written a memory word at a time by using..."

I also fixed the other issues but I'll paste here the rewrite that I did
for the commit message:

"
x86/sgx: Add ptrace() support for the SGX driver

Intel Sofware Guard eXtensions (SGX) allows creation of executable blobs
called enclaves, which cannot be accessed by default when not executing
inside the enclave. Enclaves can be entered by only using predefined memory
addresses, which are defined the enclave is loaded.

However, enclaves can defined as debug enclaves during the load time. In
debug enclaves data can be read and/or written a memory word at a time by
using by using ENCLS[EDBGRD] and ENCLS[EDBGWR] leaf instructions.

Add 'access' implementation to vm_ops with the help of these functions.
This allows to use ptrace() with debug enclaves.
"

I also think that mm CC would make sense also for this patch.

/Jarkko