Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934347AbeAIBVh (ORCPT + 1 other); Mon, 8 Jan 2018 20:21:37 -0500 Received: from mga03.intel.com ([134.134.136.65]:24358 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932876AbeAIBVb (ORCPT ); Mon, 8 Jan 2018 20:21:31 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,333,1511856000"; d="scan'208";a="193411934" Date: Mon, 8 Jan 2018 17:21:22 -0800 From: Andi Kleen To: Linus Torvalds Cc: "Woodhouse, David" , "linux-kernel@vger.kernel.org" , "tim.c.chen@linux.intel.com" , "peterz@infradead.org" , "tglx@linutronix.de" , "riel@redhat.com" , "keescook@google.com" , "gnomes@lxorguk.ukuu.org.uk" , "pjt@google.com" , "dave.hansen@intel.com" , "luto@amacapital.net" , "jikos@kernel.org" , "gregkh@linux-foundation.org" Subject: Re: [PATCH v6 11/10] x86/retpoline: Avoid return buffer underflows on context switch II Message-ID: <20180109012122.GA18313@tassilo.jf.intel.com> References: <1515363085-4219-1-git-send-email-dwmw@amazon.co.uk> <1515455051.15588.7.camel@infradead.org> <1515455902.4423.59.camel@amazon.co.uk> <20180109004415.GG6718@tassilo.jf.intel.com> <20180109011602.GH6718@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180109011602.GH6718@tassilo.jf.intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Mon, Jan 08, 2018 at 05:16:02PM -0800, Andi Kleen wrote: > > If we clear the registers, what the hell are you going to put in the > > RSB that helps you? > > RSB allows you to control chains of gadgets. I admit the gadget thing is a bit obscure. There's another case we were actually more worried about: On Skylake and Broadwell when the RSB underflows it will fall back to the indirect branch predictor, which can be poisoned and we try to avoid using with retpoline. So we try to avoid underflows, and this filling helps us with that. Does that make more sense? -Andi