[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrWpMxoX00SfnCgYdNbT5JmnzHNJ+73NmUjebBEjk7DuJA@mail.gmail.com>
Date: Mon, 22 Apr 2019 18:29:06 -0700
From: Andy Lutomirski <luto@...nel.org>
To: Cedric Xing <cedric.xing@...el.com>
Cc: LKML <linux-kernel@...r.kernel.org>, X86 ML <x86@...nel.org>,
linux-sgx@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Dave <dave.hansen@...el.com>,
Sean J <sean.j.christopherson@...el.com>, nhorman@...hat.com,
npmccallum@...hat.com, Serge <serge.ayoun@...el.com>,
Shay <shay.katz-zamir@...el.com>,
Haitao <haitao.huang@...el.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>,
Kai <kai.svahn@...el.com>, Borislav Petkov <bp@...en8.de>,
Josh Triplett <josh@...htriplett.org>,
Andrew Lutomirski <luto@...nel.org>, Kai <kai.huang@...el.com>,
David Rientjes <rientjes@...gle.com>,
Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
Subject: Re: [RFC PATCH v1 3/3] selftests/x86: Augment SGX selftest to test
new __vdso_sgx_enter_enclave() and its callback interface
On Mon, Apr 22, 2019 at 5:37 PM Cedric Xing <cedric.xing@...el.com> wrote:
>
> Given the changes to __vdso_sgx_enter_enclave(), the selftest is augmented to
> test the newly added callback interface. This addtional test marks the whole
> enclave range as PROT_READ, and calls mprotect() upon #PFs to add necessary PTE
> permissions per PFEC (#PF Error Code) until the enclave finishes.
Nifty.
What's not tested here is running this code with EFLAGS.TF set and
making sure that it unwinds correctly. Also, Jarkko, unless I missed
something, the vDSO extable code likely has a bug. If you run the
instruction right before ENCLU with EFLAGS.TF set, then do_debug()
will eat the SIGTRAP and skip to the exception handler. Similarly, if
you put an instruction breakpoint on ENCLU, it'll get skipped. Or is
the code actually correct and am I just remembering wrong?
--Andy
Powered by blists - more mailing lists