Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4175716imm; Wed, 5 Sep 2018 11:58:48 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdar3Zyt3gpwmN4XmEjD7T+Tn+BPacoUJplIy+fQdQglYpxzUtGcT/MLCAglhzQs9S7Q023j X-Received: by 2002:a17:902:9893:: with SMTP id s19-v6mr40535618plp.130.1536173928081; Wed, 05 Sep 2018 11:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536173928; cv=none; d=google.com; s=arc-20160816; b=Cs0lCIbpr0HisExjwVWb3mbO83WY88uL0jWCu/lDO4Amj0ogK0r3TupHJfss8eGY4j ITohTmNSa8a9Jh2Z5unlH+/xBbNeJ3rDTwTz8Ah4r5nxTvx15voUI0b4rAPLn1qAcmOz pCyRo1D6IzUukpWb6yJDQsgMsha2mzDBwj3M6JKcFmFdxgJZoU8ccEXMZORCKNMT6rks fjdoSVAbYlZRURzL8APzSNgCxCgDsEW7S+EjSuWW73QVF1tytHY3BdUAhMyA15Y2diG7 EB3pZbzvOBhU1a7xuQ6BaS6yySWqyaoCWdM+OxecqbNrQEzgJPEzNDwyw6iQpfxU88CZ q6rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=eUlXs85ae9ElsPlYdSYa7Ouwvja3W9FuxWUf1gzGJ/0=; b=z+ndBtTFo08ZhrMAekYwVbWqQRo0v7Wla9ccoL3geq/xvmcIw6V3WfQo4vqBJVGYpm AB65lN/GAnOy+6wOdlxuaE6yK6Fjl0s0ISK07mwfYw3xd7Ez35Jd2qlUgr9ZX4lvlzIX Lrd1C2JLx4awmFONZYR7of0p5VimyC/843tySJCOF22R6hzwSQT7HY3MobWzbkTYkR43 2vV0cns+SVTD1VdV0lHRmobuoEKCBKPGMXXMCDMqf4O7MJWfWjBY8RPRDpfFh32nI8go idwlsVtBcKBwFL3/jKZ+V+Ui58gZoKugIm6842fHrU5RsnkGpa0WwsFPBw0fzVden7zD /wng== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=WTGeZoKm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r8-v6si2816418pgl.392.2018.09.05.11.58.31; Wed, 05 Sep 2018 11:58:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=WTGeZoKm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727715AbeIEX15 (ORCPT + 99 others); Wed, 5 Sep 2018 19:27:57 -0400 Received: from merlin.infradead.org ([205.233.59.134]:35742 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbeIEX14 (ORCPT ); Wed, 5 Sep 2018 19:27:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=eUlXs85ae9ElsPlYdSYa7Ouwvja3W9FuxWUf1gzGJ/0=; b=WTGeZoKmXrEV8C/IC2/txYpSe Tus3l88kdVrFjJVJzv7z5z0USbr2TZuvM+ST6YbeMCkPrdpKt5vpLvlsHXjF+jRGLo3x9+j9YwP6Q GNssX94idoMAkmsplGlQIUR+P02iTZemB/Iz1z5KMBBaxIU22Tm66fleBfqps0s+soq+Mg8/JLonp zdVVJl6NSKSO7eYetP+jj5ze6c6OcEeSvibCQ1Xydm1NBNpTaA9pNC0+aDzUnimyxhX/ZwfIQiEzZ 1e1BEV6Gwz2pCETy8vC8l2j1ck0B9cMrnVwPmGEREJJKPFw5VAEaU+HqUJHPPozmFOEMswW6+IBO5 2o5e8aMPA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fxcyR-0000ru-0R; Wed, 05 Sep 2018 18:56:19 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A692020210311; Wed, 5 Sep 2018 20:56:17 +0200 (CEST) Date: Wed, 5 Sep 2018 20:56:17 +0200 From: Peter Zijlstra To: Nadav Amit Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, Ingo Molnar , x86@kernel.org, Arnd Bergmann , linux-arch@vger.kernel.org, Dave Hansen , Nadav Amit , Jiri Kosina , Andy Lutomirski , Masami Hiramatsu , Kees Cook Subject: Re: [PATCH v2 0/6] x86/alternatives: text_poke() fixes Message-ID: <20180905185617.GC24082@hirez.programming.kicks-ass.net> References: <20180902173224.30606-1-namit@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180902173224.30606-1-namit@vmware.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 02, 2018 at 10:32:18AM -0700, Nadav Amit wrote: > This patch-set addresses some issues that were raised in a recent > correspondence and might affect the security and the correctness of code > patching. (Note that patching performance is not addressed by this > patch-set). > > The main issue that the patches deal with is the fact that the fixmap > PTEs that are used for patching are available for access from other > cores and might be exploited. They are not even flushed from the TLB in > remote cores, so the risk is even higher. Address this issue by > introducing a temporary mm that is only used during patching. > Unfortunately, due to init ordering, fixmap is still used during > boot-time patching. Future patches can eliminate the need for it. > Remind me; why are we doing it like this instead of fixing fixmap? Because while this fixes the text_poke crud, it does leave fixmap broken.