Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5049311ima; Tue, 5 Feb 2019 05:41:12 -0800 (PST) X-Google-Smtp-Source: AHgI3IZGZSW8rfe8kzhmeXl7lpQZO/yRAO+D3zGqA0WL5MmjpeFGBN6W+f2iTeIZcv/FQ/m0AcXe X-Received: by 2002:a63:6c48:: with SMTP id h69mr4445767pgc.139.1549374072268; Tue, 05 Feb 2019 05:41:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549374072; cv=none; d=google.com; s=arc-20160816; b=rNBHCK2CAx4zIunfwyzihAxpbCgQr1bO/jtuopSDt+YBCRojOT+6dlSM7H9uppcEHq B/dDVqNg0WzSRXp+L/ASMsk+hNW7F4ehBDj8+Noel9QHaiG/TJA+q8s+gDljdcCAy2IK OPkNvBmCLrlcE6QjoTKZJ8rnEYwK9vA0t9GkyWLLRczt8P4xIxwjz4KhjgxEU5F94l0G 2bmoK2ijuawwZm6AFcTVyoHz8616lA84w9hg8vwzOrjBmsuYAcbY0gizQDTOb5tEmJeE HucSjNZSdhNddJhGDEwwEGYnd5njKHW8kuKeIPGN21/U6yciYJzx+XUD+o5VyLpZbeZ/ rjbw== 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=+l45x5l0P651QToTgntqm4C4rBuYwaWF/YbxeJcL2io=; b=KZimry6u/R/Odmsip0VOTHsMlmOqm645COJmhyr+LrZhZHPQeAZOy79L55IvE/LUjU hbfaexc326csjBAP3EEc1w2R4aAAIA5mbMuKs/H5FUBr5YO1//93bG1JpHxDrJzN7JkG cZnBvg0yiMzftehq9MIDVSl1gBm9YJAoog5hD8s4I6Qcpp4l+Tgsl6154y1tCiY4izWf l+AR0wXwNnncu6VMObMryV80cx7c5IXNqI/pKs8an2uORnQy8Xt3IrmU32nmGTpJf82w D8UCCOGFVitZYVGuY0z/iakIIkg6AkkJ+J8Tm9aFcXeV5mpgDWY3lQ7pcrkV/xuV1Wym DTug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Pcx+6gkP; 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 i16si3018031pgk.445.2019.02.05.05.40.46; Tue, 05 Feb 2019 05:41:12 -0800 (PST) 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=bombadil.20170209 header.b=Pcx+6gkP; 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 S1729507AbfBENZT (ORCPT + 99 others); Tue, 5 Feb 2019 08:25:19 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:41036 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726276AbfBENZT (ORCPT ); Tue, 5 Feb 2019 08:25:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=+l45x5l0P651QToTgntqm4C4rBuYwaWF/YbxeJcL2io=; b=Pcx+6gkPLdBa1ieyYGSrBM86W cluGsoVQzC2hMkhbRbBbvcd309s1CoJjgS8x3tyXcriGoNdWG4+Z1ApqrCrmflsbikjhAWgYdXLIm 5VtZ84kTOXNSEEJCU2oPV7toJzb9bsmDs5sAWjqM/9HoDb8jZiKaeLe6fglkiNHCyBuxWFeOkbK3A MqMnbfWYhbM5bmqVdTmFDnW738MZR1o1akvR+72MWee5cFKjAdchbhuCAolzuUKVnpFfQ+4oEhHue DEEMlRNJwbJ2KT75VJf/XcinLApF6zKOOhzZLVaeryeSMnWmHf5w99bCrg1Auwa3uPU0l+nf3hNIW LIaeKvqPw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gr0ir-0006Jc-5O; Tue, 05 Feb 2019 13:25:09 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9EB66202A2A0F; Tue, 5 Feb 2019 14:25:07 +0100 (CET) Date: Tue, 5 Feb 2019 14:25:07 +0100 From: Peter Zijlstra To: Borislav Petkov Cc: Rick Edgecombe , Andy Lutomirski , Ingo Molnar , linux-kernel@vger.kernel.org, x86@kernel.org, hpa@zytor.com, Thomas Gleixner , Nadav Amit , Dave Hansen , linux_dti@icloud.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, akpm@linux-foundation.org, kernel-hardening@lists.openwall.com, linux-mm@kvack.org, will.deacon@arm.com, ard.biesheuvel@linaro.org, kristen@linux.intel.com, deneen.t.dock@intel.com, Nadav Amit , Kees Cook , Dave Hansen , Masami Hiramatsu Subject: Re: [PATCH v2 06/20] x86/alternative: use temporary mm for text poking Message-ID: <20190205132507.GS17528@hirez.programming.kicks-ass.net> References: <20190129003422.9328-1-rick.p.edgecombe@intel.com> <20190129003422.9328-7-rick.p.edgecombe@intel.com> <20190205095853.GJ21801@zn.tnic> <20190205113146.GP17528@hirez.programming.kicks-ass.net> <20190205123533.GN21801@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190205123533.GN21801@zn.tnic> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 05, 2019 at 01:35:33PM +0100, Borislav Petkov wrote: > On Tue, Feb 05, 2019 at 12:31:46PM +0100, Peter Zijlstra wrote: > > ... > > > > So while in general I agree with BUG_ON() being undesirable, I think > > liberal sprinking in text_poke() is fine; you really _REALLY_ want this > > to work or fail loudly. Text corruption is just painful. > > Ok. It would be good to have the gist of this sentiment in a comment > above it so that it is absolutely clear why we're doing it. > > And since text_poke() can't fail, then it doesn't need a retval too. > AFAICT, nothing is actually using it. See patch 12, that removes the return value (after fixing the few users that currently 'rely' on it).