Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756463AbeAHKjB (ORCPT + 1 other); Mon, 8 Jan 2018 05:39:01 -0500 Received: from mx2.suse.de ([195.135.220.15]:50573 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755247AbeAHKjA (ORCPT ); Mon, 8 Jan 2018 05:39:00 -0500 Date: Mon, 8 Jan 2018 11:38:56 +0100 (CET) From: Jiri Kosina To: Paul Turner cc: David Woodhouse , Andi Kleen , LKML , Linus Torvalds , Greg Kroah-Hartman , Tim Chen , Dave Hansen , Thomas Gleixner , Kees Cook , Rik van Riel , Peter Zijlstra , Andy Lutomirski , One Thousand Gnomes Subject: Re: [PATCH v6 00/10] Retpoline: Avoid speculative indirect calls in kernel In-Reply-To: Message-ID: References: <1515363085-4219-1-git-send-email-dwmw@amazon.co.uk> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Mon, 8 Jan 2018, Paul Turner wrote: > user->kernel in the absence of SMEP: > In the absence of SMEP, we must worry about user-generated RSB entries > being consumable by kernel execution. > Generally speaking, for synchronous execution this will not occur (e.g. > syscall, interrupt), however, one important case remains. > When we context switch between two threads, we should flush the RSB so that > execution generated from the unbalanced return path on the thread that we > just scheduled into, cannot consume RSB entries potentially installed by > the prior thread. I am still unclear whether this closes it completely, as when HT is on, the RSB is shared between the threads, right? Therefore one thread can poision it for the other without even context switch happening. -- Jiri Kosina SUSE Labs