Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4169182ybp; Mon, 7 Oct 2019 04:27:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtYUAhiW84uxGMCrZ63Q0TF0+yZoWdht/hj6TvAcsSlfraCURbPG6SGU7Rj2auHLm6Q6Pr X-Received: by 2002:a50:fc0c:: with SMTP id i12mr28620195edr.82.1570447660632; Mon, 07 Oct 2019 04:27:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570447660; cv=none; d=google.com; s=arc-20160816; b=TSYMJHBsNV/JzLP4ZuUlfvzF21++hDdrvgujEbSd0GvIqkXGpxrwNhgQULve/QFenI RCHpQdW65NYXFB4xtWsk9CjyDwdR3Lzz73IGZryzj+HApixMIcN8Md0I2pyACcmt4UX3 k5XNmx0+SVfep7QgT7mVx4CxfQby7MSEHQfkDMEXiBANizsvsR2yNI8HrszHyS4QVfB3 Ms0TLKTYjyIwrHGU3Pl6ZmNxHAvyOUaThp66RTIQa9SD63zvpX9rYjatWtCw+nq5xKab c/2A9mT9ZpEYnah00keviXZa0x6TGFhMG80Avv3GE1m2oWD4cmp1LjgloLza3jhCHJ8g MFrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:subject:cc:to :from:date:user-agent:message-id:dkim-signature; bh=8w7+6tXm8Cbatt6iSi3EWSSGQa+15O9GwCHiBC4CD7A=; b=wUGvgnipacQJTez0raJqeGrWL8GcIGglTVM1Tntedydm8eF44EG6gHZGvN9168nkZV UrWrnfpSgSoCnkvKDhtBdkT7UX9fMk0HcfNyvNFHEZ7ya0oHXAoe1KjobJqyc4SUSB9a t5deOtyBTDhLmxBgVQKZhE655glGSuMF6GmhR3Bp+WpA/4ptQxeIFcWET/gE8pZGyLik t6oMN2drWKXBbgBMKn4IfejKWBsCaYAgr8u9VeKwS2wRrrN4kXAv/9zm/z2YCVdSspoK eQcnktuCt43A9VZOdEgrreBzXQEwawSYXymPeqMTIbNYlnOSwgASxo6rbhtf2b1GViu7 L8XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ulXHz4f7; 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 d58si8685688eda.62.2019.10.07.04.27.16; Mon, 07 Oct 2019 04:27:40 -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=ulXHz4f7; 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 S1728056AbfJGLY3 (ORCPT + 99 others); Mon, 7 Oct 2019 07:24:29 -0400 Received: from merlin.infradead.org ([205.233.59.134]:58426 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727924AbfJGLXw (ORCPT ); Mon, 7 Oct 2019 07:23:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-Id:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8w7+6tXm8Cbatt6iSi3EWSSGQa+15O9GwCHiBC4CD7A=; b=ulXHz4f7WW7364dUiGQvC56pD2 xZwJbVwNySo6seuSQIekOQghheceObV9JDTPq1182FMRb2PRDWNcbIdn9E8ZeVcOqHO4Y/SJS24ua /olfNzDmFuo3umDMBKpL0IQhqDv6XtwQ/Arato6A+7MuWVUx6GTvViRFTYrwTdrInQN0cYKP/Rlwm TuQan99S8ClcmPAsmvZoASQdy3t4NwIGhbrul9bwGXgJbYThMZwwOncVK9e2VtnpKgcRjnUry+nvo 3RviFwO/MSzxqYluYqcos9vsYTso3mrxjKH+61VHZoMXxw2garKrGvAtIz4umPu4WLztDSAIqFYuR N334e3xA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHR6w-0002BD-R8; Mon, 07 Oct 2019 11:23:31 +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 027AB30703D; Mon, 7 Oct 2019 13:22:36 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id 8DB7220244E22; Mon, 7 Oct 2019 13:23:26 +0200 (CEST) Message-Id: <20191007082700.14428791.6@infradead.org> User-Agent: quilt/0.65 Date: Mon, 07 Oct 2019 10:25:44 +0200 From: Peter Zijlstra To: x86@kernel.org Cc: peterz@infradead.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, Yonghong Song , Alexei Starovoitov , Daniel Borkmann , Song Liu , Jessica Yu , Martin KaFai Lau Subject: [PATCH v2 3/4] module: Properly propagate MODULE_STATE_COMING failure References: <20191007082541.64146933.7@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that notifiers got unbroken; use the proper interface to handle notifier errors and propagate them. There were already MODULE_STATE_COMING notifiers that failed; notably: - jump_label_module_notifier() - tracepoint_module_notify() - bpf_event_notify() By propagating this error, we fix those users. Signed-off-by: Peter Zijlstra (Intel) Cc: Yonghong Song Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Song Liu Cc: Jessica Yu Cc: Martin KaFai Lau --- kernel/module.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- a/kernel/module.c +++ b/kernel/module.c @@ -3751,9 +3751,13 @@ static int prepare_coming_module(struct if (err) return err; - blocking_notifier_call_chain(&module_notify_list, - MODULE_STATE_COMING, mod); - return 0; + err = blocking_notifier_call_chain_robust(&module_notify_list, + MODULE_STATE_COMING, MODULE_STATE_GOING, mod); + err = notifier_to_errno(err); + if (err) + klp_module_going(mod); + + return err; } static int unknown_module_param_cb(char *param, char *val, const char *modname,