Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754979AbeAOMr3 convert rfc822-to-8bit (ORCPT + 1 other); Mon, 15 Jan 2018 07:47:29 -0500 Received: from smtp-out4.electric.net ([192.162.216.187]:51410 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934939AbeAOMrM (ORCPT ); Mon, 15 Jan 2018 07:47:12 -0500 From: David Laight To: 'Andi Kleen' , "tglx@linutronix.de" CC: "dwmw@amazon.co.uk" , "torvalds@linux-foundation.org" , "linux-kernel@vger.kernel.org" , "gregkh@linuxfoundation.org" , "arjan.van.de.ven@intel.com" , "peterz@infradead.org" , Andi Kleen , "jeyu@kernel.org" Subject: RE: [PATCH] retpoline/module: Taint kernel for missing retpoline in module Thread-Topic: [PATCH] retpoline/module: Taint kernel for missing retpoline in module Thread-Index: AQHTi860jk9MskcOgkmU8nWyTxRfhqN05Lpw Date: Mon, 15 Jan 2018 12:47:48 +0000 Message-ID: References: <20180112175507.31750-1-andi@firstfloor.org> In-Reply-To: <20180112175507.31750-1-andi@firstfloor.org> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.33] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 156.67.243.126 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuMS.aculab.com X-TLS: TLSv1.2:ECDHE-RSA-AES256-SHA384:256 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Andi Kleen > Sent: 12 January 2018 17:55 > > There's a risk that a kernel that has full retpoline mitigations > becomes vulnerable when a module gets loaded that hasn't been > compiled with the right compiler or the right option. > > We cannot fix it, but should at least warn the user when that > happens. > > Add a flag to each module if it has been compiled with RETPOLINE > > When the a module hasn't been compiled with a retpoline > aware compiler, print a warning and set a taint flag. > > For modules it is checked at compile time, however it cannot > check assembler or other non compiled objects used in the module link. It is not unlikely that most of a module's code is released as a binary 'blob', with only the part that needs to match the kernel ABI compiled on the target system. (This allows a single binary driver be loaded onto different Linux kernel versions.) Such code is unlikely to be compiled with the latest compiler. Indeed, doing so may stop the module loading on old kernels. David