Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869AbeADAbm (ORCPT + 1 other); Wed, 3 Jan 2018 19:31:42 -0500 Received: from www.llwyncelyn.cymru ([82.70.14.225]:42106 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751659AbeADAbl (ORCPT ); Wed, 3 Jan 2018 19:31:41 -0500 Date: Thu, 4 Jan 2018 00:29:16 +0000 From: Alan Cox To: Andi Kleen Cc: Thomas Gleixner , 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 Message-ID: <20180104002916.3ff66581@alans-desktop> In-Reply-To: <20180104001501.3jof7zkrfkehnd3r@two.firstfloor.org> References: <20180103230934.15788-1-andi@firstfloor.org> <20180104000927.co5umvfzfwliqvqt@two.firstfloor.org> <20180104001501.3jof7zkrfkehnd3r@two.firstfloor.org> Organization: Intel Corporation X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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. Alan