Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752948AbeADLtW (ORCPT + 1 other); Thu, 4 Jan 2018 06:49:22 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:58667 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752922AbeADLtU (ORCPT ); Thu, 4 Jan 2018 06:49:20 -0500 Date: Thu, 4 Jan 2018 12:49:17 +0100 From: Pavel Machek To: Andi Kleen Cc: tglx@linutronix.de, torvalds@linux-foundation.org, gregkh@linux-foundation.org, linux-kernel@vger.kernel.org, tim.c.chen@linux.intel.com Subject: Re: Avoid speculative indirect calls in kernel Message-ID: <20180104114917.GC1702@amd> References: <20180104020019.1173-1-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wq9mPyueHGvFACwf" Content-Disposition: inline In-Reply-To: <20180104020019.1173-1-andi@firstfloor.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: --wq9mPyueHGvFACwf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > This is a fix for Variant 2 in=20 > https://googleprojectzero.blogspot.com/2018/01/reading-privileged-memory-= with-side.html >=20 > Any speculative indirect calls in the kernel can be tricked=20 > to execute any kernel code, which may allow side channel > attacks that can leak arbitrary kernel data. Ok. > So we want to avoid speculative indirect calls in the kernel. >=20 > There's a special code sequence called a retpoline that can > do indirect calls without speculation. We use a new compiler > option -mindirect-branch=3Dthunk-extern (gcc patch will be released > separately) to recompile the kernel with this new sequence. So... this "retpoline" code is quite tricky; I guess it does the right on recent Intel CPUs. Does it also do the right thing on all the AMD, Cyrix, ... variants? Is it neccessary on all the CPUs? I guess 486 does not need this? Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --wq9mPyueHGvFACwf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlpOFL0ACgkQMOfwapXb+vL4qgCffUJxY7roOZ+wog33k23Ut+Oa 4vcAoKr4m0pHc/HcOulhTecu+4ZmAvIt =a4hS -----END PGP SIGNATURE----- --wq9mPyueHGvFACwf--