Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4321736ybg; Mon, 21 Oct 2019 07:16:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNgp6q7mv4FyLjK+4/5GiRqOcsIKNUc7LiUSq0CX9SXscxL6xcv1FPTBIKvTLd/4OBfaEP X-Received: by 2002:a17:906:792:: with SMTP id l18mr21721245ejc.170.1571667384137; Mon, 21 Oct 2019 07:16:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571667384; cv=none; d=google.com; s=arc-20160816; b=xZYiyWKS+ycA3whNNo1tt7oTUtYp9L93xkGEp0z1GLDc92gBed/JFMf2/J8t/WU8Hm 1Tud1jCdj/PO7VCi2/aZhUOKxw2/HJVocLEkJ+w6RvH4c2fhYQb3wYMy3U1oEoXVyQmS fpS0wLGnEMMeEuIG6WEFubDKyuilXGqH+iU5PA9/Sy2lEJRyCAc3CdVUrNHFGHcod/S0 QHywAkxTKWNnCf1bd/fHOE/k0qPLLAooBRNQ/laXhXSbl3qdwdOOqeh13Ry8g1LfIFTI vl58ERBUAnqFy1R8h3WlQ/gUTNwmqgbAKELIRrpcmEYS3z488axB2BAYsQKzx2kjRvuQ 2Gdg== 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=3plDKgnJ0HIBgorG9S0obRwxJpV76imeOkBiLbgmUVo=; b=bzfSf7sweaDmpLb8uE9+xorTe/nqYjr5vwEJ+1I1aXNNtxIUaKng0EiJk6xNrlzJc0 U/+PS/xwlZ0E3THtkeGu+NZCRUG6m+KmCq+9c8Z8vXT4pEGhop2op1jDD1BCai0g7QeV v0sZKCEKqTPBONAByWoN1inkETpzZyPM5HxKnh7vJj3rREMr0r460RqUYsWw/aoR7gI2 u9JASI0F6CFxShlPhdGS27KdrCUR0IsqqSMJKx14vK2Sl8A/ltRJ1JHAvVIo6pOFMe9z mJtd5M8KgUal4AFhnmGdGBgsEuVEH/ilCB45qcZmiyJF/PVebE4jZZtCJaEgnjUR1lCi 5pOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jI96QAyV; 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 l21si8471557eje.331.2019.10.21.07.16.01; Mon, 21 Oct 2019 07:16:24 -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=bombadil.20170209 header.b=jI96QAyV; 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 S1729245AbfJUOOO (ORCPT + 99 others); Mon, 21 Oct 2019 10:14:14 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:37506 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727755AbfJUOON (ORCPT ); Mon, 21 Oct 2019 10:14:13 -0400 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=3plDKgnJ0HIBgorG9S0obRwxJpV76imeOkBiLbgmUVo=; b=jI96QAyV+T8iQka+zb2k3I0La m5+z/93EllmecZGX0rVGGpiis5VkADLMV5wnm55qT6CXkwj0jMYqhaRQJTV1a7wvzmMLMK6irIIOL CHtkc8dChg33RvYj4823hFfOy0HzSlWiV+JnjwteEneEU0ltXVwLZTgQ3WjzkMl0GT3wdGJ1ZpzlV gNms5sh2NJgWh0H2Y7PO54X+SZ8syV7/q1USt595HeKzAKxQTpGoPFK6GGlJsSPOIhLzWiiFKT2ei Z760kUW793RxEOPoct4W/LBCEQXMtlbH5kQ9LIbn7VGqU23XqGQTRyCbMmqhDp8faYXuA9qaJXcVM dCERYIv/A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iMYRh-0007cr-4G; Mon, 21 Oct 2019 14:14:05 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9CBED300EBF; Mon, 21 Oct 2019 16:13:05 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9E496238D26BE; Mon, 21 Oct 2019 16:14:02 +0200 (CEST) Date: Mon, 21 Oct 2019 16:14:02 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, rostedt@goodmis.org, mhiramat@kernel.org, bristot@redhat.com, jbaron@akamai.com, torvalds@linux-foundation.org, tglx@linutronix.de, mingo@kernel.org, namit@vmware.com, hpa@zytor.com, luto@kernel.org, ard.biesheuvel@linaro.org, jeyu@kernel.org Subject: Re: [PATCH v4 15/16] module: Move where we mark modules RO,X Message-ID: <20191021141402.GI1817@hirez.programming.kicks-ass.net> References: <20191018073525.768931536@infradead.org> <20191018074634.801435443@infradead.org> <20191021135312.jbbxsuipxldocdjk@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191021135312.jbbxsuipxldocdjk@treble> 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 Mon, Oct 21, 2019 at 08:53:12AM -0500, Josh Poimboeuf wrote: > On Fri, Oct 18, 2019 at 09:35:40AM +0200, Peter Zijlstra wrote: > > Now that set_all_modules_text_*() is gone, nothing depends on the > > relation between ->state = COMING and the protection state anymore. > > This enables moving the protection changes later, such that the COMING > > notifier callbacks can more easily modify the text. > > > > Signed-off-by: Peter Zijlstra (Intel) > > Cc: Jessica Yu > > --- > > kernel/module.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > --- a/kernel/module.c > > +++ b/kernel/module.c > > @@ -3683,10 +3683,6 @@ static int complete_formation(struct mod > > /* This relies on module_mutex for list integrity. */ > > module_bug_finalize(info->hdr, info->sechdrs, mod); > > > > - module_enable_ro(mod, false); > > - module_enable_nx(mod); > > - module_enable_x(mod); > > - > > /* Mark state as coming so strong_try_module_get() ignores us, > > * but kallsyms etc. can see us. */ > > mod->state = MODULE_STATE_COMING; > > @@ -3852,6 +3848,10 @@ static int load_module(struct load_info > > if (err) > > goto bug_cleanup; > > > > + module_enable_ro(mod, false); > > + module_enable_nx(mod); > > + module_enable_x(mod); > > + > > /* Module is ready to execute: parsing args may do that. */ > > after_dashes = parse_args(mod->name, mod->args, mod->kp, mod->num_kp, > > -32768, 32767, mod, > > [ Sorry if this was already discussed, I still have a large backlog. ] > > Doesn't livepatch code also need to be modified? We have: Urgh bah.. I was too focussed on the other klp borkage :/ But yes, arm64/ftrace and klp are the only two users of that function (outside of module.c) and Mark was already writing a patch for arm64. Means these last two patches need to wait a little until we've fixed those.