linux-sgx.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: linux-sgx@vger.kernel.org,
	Sean Christopherson <sean.j.christopherson@intel.com>
Subject: Re: [PATCH] x86/sgx: Uncoditionally disallow SGX if MSRs are not writable
Date: Thu, 23 Jan 2020 15:34:23 +0100	[thread overview]
Message-ID: <20200123143423.GE10328@zn.tnic> (raw)
In-Reply-To: <20200123130746.20377-1-jarkko.sakkinen@linux.intel.com>

On Thu, Jan 23, 2020 at 03:07:46PM +0200, Jarkko Sakkinen wrote:
> As suggested by Borislav, disallow SGX if the PK MSRs are not writable.
> 
> Link: https://patchwork.kernel.org/patch/11267757/#23072371
> Cc: Sean Christopherson <sean.j.christopherson@intel.com>
> Suggested-by: Borislav Petkov <bp@alien8.de>
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> ---
> Just a sanity check before merge, please ack that this is what you
> wanted.
>  arch/x86/kernel/cpu/intel.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
> index 06252c82b8f7..0d57e9666de0 100644
> --- a/arch/x86/kernel/cpu/intel.c
> +++ b/arch/x86/kernel/cpu/intel.c
> @@ -600,7 +600,7 @@ static void __maybe_unused detect_sgx(struct cpuinfo_x86 *c)
>  
>  	if (!(fc & FEATURE_CONTROL_SGX_LE_WR)) {
>  		pr_info_once("sgx: The launch control MSRs are not writable\n");
> -		goto err_msrs_rdonly;
> +		goto err_unsupported;
>  	}
>  
>  	return;
> @@ -609,8 +609,6 @@ static void __maybe_unused detect_sgx(struct cpuinfo_x86 *c)
>  	setup_clear_cpu_cap(X86_FEATURE_SGX);
>  	setup_clear_cpu_cap(X86_FEATURE_SGX1);
>  	setup_clear_cpu_cap(X86_FEATURE_SGX2);
> -
> -err_msrs_rdonly:
>  	setup_clear_cpu_cap(X86_FEATURE_SGX_LC);
>  }
>  
> -- 

Yap, looks about right.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

      reply	other threads:[~2020-01-23 14:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23 13:07 [PATCH] x86/sgx: Uncoditionally disallow SGX if MSRs are not writable Jarkko Sakkinen
2020-01-23 14:34 ` Borislav Petkov [this message]

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=20200123143423.GE10328@zn.tnic \
    --to=bp@alien8.de \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=linux-sgx@vger.kernel.org \
    --cc=sean.j.christopherson@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).