From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: "Xing, Cedric" <cedric.xing@intel.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Jethro Beekman <jethro@fortanix.com>,
Sean Christopherson <sean.j.christopherson@intel.com>,
linux-sgx@vger.kernel.org, x86@kernel.org,
Haitao Huang <haitao.huang@linux.intel.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Andy Lutomirski <luto@amacapital.net>
Subject: Re: [PATCH] x86/vdso: Remove retpoline from SGX vDSO call
Date: Thu, 1 Oct 2020 02:41:45 +0300 [thread overview]
Message-ID: <20200930234145.GA71808@linux.intel.com> (raw)
In-Reply-To: <bc09f081-d0e8-20dc-350e-c7dbdf077a52@intel.com>
On Wed, Sep 30, 2020 at 02:46:05PM -0700, Dave Hansen wrote:
> On 9/30/20 2:36 PM, Jarkko Sakkinen wrote:
> > 1. Full reptoline is the safest alternative and we have it done already.
>
> I wouldn't feel _quite_ comfortable saying this.
>
> LFENCEs have architecturally defined behavior. Retpolines have zero
> future guarantees in the architecture. I'll take an LFENCE that (versus
> a retpoline) is:
>
> 1. Less code
> 2. Never has to be patched
> 3. Never causes functional problems (like with CET)
> 4. Has architectural semantics
>
> The only advantage retpolines offer is that they have a well-defined
> mitigations on existing microarchitectures.
>
> To me, an LFENCE is waaaaaaay "safer".
This is a buy-in argument for me.
We know that CET-SS breaks RETPOLINE, which can be solved by applying
boot time patching. However, there could be however many other features
that could conflict with it in yet non-existing microarchitectures,
which would make the patching process tedious to manage over time.
Essentially, we will end up maintaining the backward and forward
compatibility forever in software. That does not sound too motivating,
agreed.
"Plain" LFENCE does not possess this issue as it is fully contained to
the microarchitecture. Thus, software does not have to do anything to
maintain backward and forward compatibility, which means that the SGX
vDSO continues to functionally work even in the old kernel images to
forseeable future.
To summarize, we will use LFENCE as it has overally the best
characteristics for the vDSO when balancing between security and keeping
things functionally working.
Do I have the correct understanding of your argument? Just sanity
checking before I change any part of the code or documentation.
/Jarkko
next prev parent reply other threads:[~2020-09-30 23:42 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-30 14:01 [PATCH] x86/vdso: Remove retpoline from SGX vDSO call Jarkko Sakkinen
2020-09-30 14:08 ` Dave Hansen
2020-09-30 14:20 ` Jarkko Sakkinen
2020-09-30 14:33 ` Dave Hansen
2020-09-30 15:28 ` Jarkko Sakkinen
2020-09-30 15:43 ` Sean Christopherson
2020-09-30 16:28 ` Dave Hansen
2020-09-30 17:01 ` Jethro Beekman
2020-09-30 18:09 ` Andrew Cooper
2020-09-30 19:25 ` Jarkko Sakkinen
2020-09-30 20:45 ` Xing, Cedric
2020-09-30 21:22 ` Jarkko Sakkinen
2020-09-30 21:36 ` Jarkko Sakkinen
2020-09-30 21:46 ` Dave Hansen
2020-09-30 23:41 ` Jarkko Sakkinen [this message]
2020-09-30 16:38 ` Jarkko Sakkinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200930234145.GA71808@linux.intel.com \
--to=jarkko.sakkinen@linux.intel.com \
--cc=andrew.cooper3@citrix.com \
--cc=bp@alien8.de \
--cc=cedric.xing@intel.com \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=haitao.huang@linux.intel.com \
--cc=jethro@fortanix.com \
--cc=linux-sgx@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=sean.j.christopherson@intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.