From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x224nmxgi0qnW/JaJwiBSp08B9PuHuUwH9UBUuI7dzucrrv5Ky89uXPz0GRvGBVJ9fPoHQqwB ARC-Seal: i=1; a=rsa-sha256; t=1516748763; cv=none; d=google.com; s=arc-20160816; b=wvq1b2Rh60nX3mIyX/wwxlNy8wdWAtSNJL+lOIdXxfvZGxKY0RaPnW+oZmvq8WQJ/7 DynWlYF4QUNwbxwGvBa2o1SqBIP+cFpMrZxTK/yubtrJ7SbqOXiDmK4+O75pc/hDj+5u E/k1VPcICrJI9ZDS7QhUWhqJjR0u4KcSim5i7yE5mBBC+RN5HJLizaZzIe4q01JJj6Mi 99GGeqHKxuCZ5jj/LB5Pd7DJV0jJYtmYwywuLRcfI/L3Q87PP/3byvORskkQVVRfdggD 1X8Oma5AD1tpZJNHKz1JW/9AmhcSsuaf0nWU8Rkfoe9vrYxt47xsQkZbDD5Fuzyc8mRR JfUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:arc-authentication-results; bh=ZDnE82dyKUISojd7cmOnWNPojJZBMxKIZFO9YMiy63I=; b=s58givIdwqnoDmDzFOMvoGkNr1a8q3aKbU4d8iT9xdplxoI8kk6ysgYHkgWVqC+Z+6 ixpX+465+glBuWYGFdK5qLEptvf2PC044hXw6VDrnOE6tx3KHyY929QekpADUNzFARbI eNJNZ9TRTXmUC2d0ptXs9484H5rR4g7f++PytJx+NpITRHaJNbM0GFAejmnWFnqjnl2P cK62EgId4W9wkhmC8aENujbYCFCUo2Y19DUm29GOdJRNHlIKv7RBJ8Fw8COWaAyWgmsm ath6CmXgH4Fx59uJozMfB1xGLiDGqrTJfBzfo//js7EYkFoNVtssownhvT4WYGUsacR5 cxgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of ak@linux.intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=ak@linux.intel.com Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of ak@linux.intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=ak@linux.intel.com X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,403,1511856000"; d="scan'208";a="12534730" Date: Tue, 23 Jan 2018 15:05:53 -0800 From: Andi Kleen To: David Woodhouse Cc: Borislav Petkov , Paul Turner , LKML , Linus Torvalds , Greg Kroah-Hartman , Tim Chen , Dave Hansen , tglx@linutronix.de, Kees Cook , Rik van Riel , Peter Zijlstra , Andy Lutomirski , Jiri Kosina , gnomes@lxorguk.ukuu.org.uk, x86@kernel.org, thomas.lendacky@amd.com, Josh Poimboeuf Subject: Re: [PATCH v8 04/12] x86/spectre: Add boot time option to select Spectre v2 mitigation Message-ID: <20180123230553.GR7844@tassilo.jf.intel.com> References: <1515707194-20531-1-git-send-email-dwmw@amazon.co.uk> <1515707194-20531-5-git-send-email-dwmw@amazon.co.uk> <20180123224014.dsbzps4hydt6h7ed@pd.tnic> <1516748034.13558.15.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1516748034.13558.15.camel@infradead.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1589334464875796449?= X-GMAIL-MSGID: =?utf-8?q?1590426350520084020?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: > > And it probably should be a more reliable method which we probably could > > use to detect !retpolined modules too. > > Andi actually implemented this, but it ended up being watered down > somewhat. It's enforced in mainline with the following patch It's not fully bullet proof, but should be good enough to protect against mistakes at least. commit 6cfb521ac0d5b97470883ff9b7facae264b7ab12 Author: Andi Kleen Date: Tue Jan 16 12:52:28 2018 -0800 module: Add retpoline tag to VERMAGIC Add a marker for retpoline to the module VERMAGIC. This catches the case when a non RETPOLINE compiled module gets loaded into a retpoline kernel, making it insecure. It doesn't handle the case when retpoline has been runtime disabled. Even in this case the match of the retcompile status will be enforced. This implies that even with retpoline run time disabled all modules loaded need to be recompiled.