All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Chen <tim.c.chen@linux.intel.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Kosina <jikos@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Andi Kleen <ak@linux.intel.com>,
	Dave Hansen <dave.hansen@intel.com>,
	Casey Schaufler <casey.schaufler@intel.com>,
	Asit Mallick <asit.k.mallick@intel.com>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Jon Masters <jcm@redhat.com>,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [Patch v2 4/4] x86/speculation: Add prctl to control indirect branch speculation per process
Date: Tue, 2 Oct 2018 09:12:28 -0700	[thread overview]
Message-ID: <20a42fd4-0026-c30e-1d82-4a345f6257cc@linux.intel.com> (raw)
In-Reply-To: <20181002093530.GC122128@gmail.com>

On 10/02/2018 02:35 AM, Ingo Molnar wrote:
> 
> * Tim Chen <tim.c.chen@linux.intel.com> wrote:
> 
>> To migitgate possible app to app attack from branch target buffer poisoning,
>> a new prctl is provided to control branch speculation for applications in
>> user app.  The following interfaces are provided:
> 
> s/migitgate
>  /mitigate
> 
>>
>> prctl(PR_SET_SPECULATION_CTRL, PR_INDIR_BRANCH, PR_SPEC_DISABLE, 0, 0);
>> - Disable branch target speculation to protect against app to app
>> style attack using IBPB and STIBP
>>
>> prctl(PR_SET_SPECULATION_CTRL, PR_INDIR_BRANCH, PR_SPEC_ENABLE, 0, 0);
>> - Allow branch target speculation, no mitigation for Spectre V2
>>
>> prctl(PR_GET_SPECULATION_CTRL, PR_INDIR_BRANCH, 0, 0, 0)
>> - Query the indirect branch speculation restriction on a process
> 
> Well 'a process' is always 'the current process' in this case, right?

Right.

> 
>> -			lite   - only turn on mitigation for non-dumpable processes
>> +			lite   - turn on mitigation for non-dumpable processes
>> +				 or processes that has indirect branch restricted
>> +				 via prctl's PR_SET_SPECULATION_CTRL option
> 
> s/or processes that has indirect
>  /or processes that have been indirect
> 
> ?
> 
>> +	/*
>> +	 * If being set on non-current task, delay setting the CPU
>> +	 * mitigation until it is next scheduled.
>> +	 * Use speculative_store_bypass_update will update SPEC_CTRL MSR
>> +	 */
>> +	if (task == current && update)
>> +		speculative_store_bypass_update_current();
> 
> Did you mean:
> 
> 	Call to speculative_store_bypass_update_current() will update SPEC_CTRL MSR

Yes.

> 
> ?
> 
> 
>> -	 * For lite protection mode, we only protect the non-dumpable
>> -	 * processes.
>> +	 * For lite protection mode, we protect processes  
>> +	 * where the user explicitly disable indirect branch
>> +	 * speculation or mark the process as non-dumpable. 
> 
> s/where the user explicitly disable
>  /where the user explicitly disables
> 
> ?
> 
> Thanks,
> 
> 	Ingo
> 

Thanks for the corrections.  I'll update the patchset.

Tim

  reply	other threads:[~2018-10-02 16:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26  0:43 [Patch v2 0/4] Provide options to enable spectre_v2 userspace-userspace protection Tim Chen
2018-09-26  0:43 ` [Patch v2 1/4] x86/speculation: Option to select app to app mitigation for spectre_v2 Tim Chen
2018-10-02  9:23   ` Ingo Molnar
2018-10-02 16:24     ` Tim Chen
2018-10-02 20:04   ` Thomas Gleixner
2018-09-26  0:43 ` [Patch v2 2/4] x86/speculation: Provide application property based STIBP protection Tim Chen
2018-10-02 19:10   ` Thomas Gleixner
2018-10-04 19:19     ` Tim Chen
2018-09-26  0:43 ` [Patch v2 3/4] x86/speculation: Extend per process STIBP to AMD cpus Tim Chen
2018-09-26 17:24   ` Tim Chen
2018-09-26 19:11     ` Lendacky, Thomas
2018-10-02  9:27   ` Ingo Molnar
2018-10-02 19:02   ` Thomas Gleixner
2018-09-26  0:43 ` [Patch v2 4/4] x86/speculation: Add prctl to control indirect branch speculation per process Tim Chen
2018-10-02  9:35   ` Ingo Molnar
2018-10-02 16:12     ` Tim Chen [this message]
2018-10-03  7:25       ` Ingo Molnar
2018-10-02 17:58   ` Thomas Gleixner
2018-10-05 18:12     ` Tim Chen
2018-10-05 18:46       ` Thomas Gleixner

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=20a42fd4-0026-c30e-1d82-4a345f6257cc@linux.intel.com \
    --to=tim.c.chen@linux.intel.com \
    --cc=aarcange@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=arjan@linux.intel.com \
    --cc=asit.k.mallick@intel.com \
    --cc=casey.schaufler@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=dwmw@amazon.co.uk \
    --cc=jcm@redhat.com \
    --cc=jikos@kernel.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.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.