Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751913AbeADAbu (ORCPT + 1 other); Wed, 3 Jan 2018 19:31:50 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:40916 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751872AbeADAbs (ORCPT ); Wed, 3 Jan 2018 19:31:48 -0500 Date: Thu, 4 Jan 2018 01:31:43 +0100 (CET) From: Thomas Gleixner To: Alan Cox cc: Andi Kleen , Linus Torvalds , Greg Kroah-Hartman , dwmw@amazon.co.uk, Tim Chen , Linux Kernel Mailing List , Dave Hansen Subject: Re: Avoid speculative indirect calls in kernel In-Reply-To: <20180104002916.3ff66581@alans-desktop> Message-ID: References: <20180103230934.15788-1-andi@firstfloor.org> <20180104000927.co5umvfzfwliqvqt@two.firstfloor.org> <20180104001501.3jof7zkrfkehnd3r@two.firstfloor.org> <20180104002916.3ff66581@alans-desktop> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Thu, 4 Jan 2018, Alan Cox wrote: > On Wed, 3 Jan 2018 16:15:01 -0800 > Andi Kleen wrote: > > > > It should be a CPU_BUG bit as we have for the other mess. And that can be > > > used for patching. > > > > It has to be done at compile time because it requires a compiler option. > > > > Most of the indirect calls are in C code. > > > > So it cannot just patched in, only partially out. > > You can replace the pushl ; jmp with an alternatives section (although > there might be a lot of them). Even if gcc isn't smart enough to do that > perl is. So you say, that we finally need a perl interpreter in the kernel to do alternative patching? Thanks, tglx