Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4904048ybb; Tue, 24 Mar 2020 07:27:13 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtKWnOVV/G3EHybaP+mB1uDyq/rl3wOOamKODT4V4bY3joQzCP+oyUmYZ7rij5c/MJK7qqN X-Received: by 2002:a9d:42f:: with SMTP id 44mr1914419otc.236.1585060032832; Tue, 24 Mar 2020 07:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585060032; cv=none; d=google.com; s=arc-20160816; b=vV8K/3XMAzkoRX8Rvbr1SEFZ5EhPgY19cAT63XTT4VU/BbSmT+tbkmDbKhT+dALp3B OExuxsQViyHAlkSEKFERFFPJZJLA0qiRC3YoQXiGe/2UAis54caVNcbivoVGIwhM4wL6 s4VyqZ/DwMc11+LGHrECNxIpOj2jC4efSTwWxKnW4ogxlVT0No9wEO3DKY42hSrtvGP7 K3nepoigx1p7bx6Y+Kw85zuqTRYg/ZuqjVggdATdSyCS8A1i7HmUXID9vIg/SBY11/Kn tyyZsyVc8ABa3R2jpax/j1kOI2rGaTd7SeWSPmXb+rxaOWvbh+IOblgjpGx0lRopqQq8 ovFg== 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=BilAV98/xyLJ3rbbbATq+anaMYfZWr9rp+kix4JP/Vc=; b=d+UPJo8TyUADaIEFHDMuVgpyA1/TGW64i7FB2AT0PVwShjgzcvQSXFwgXqluB5d71Z crf3jg2lmwTBP0vfFktykawIFkwBN5wQ0zZF8z6i9jjq7OCaVHNZnaS1jkZh5Ii2zaK4 kAlYnZNEyMQvY/1QHBHJW8EotPlxtOez+S69d7e8GWa18vCzVkmRuV6ChgdcbWL1k7ly D5lm+57XF+iAIo3rAtJmu3QLYF1+XIm8lMJPrHNVACj8JCDQjK4BHdMBzgphcNFIt8ux 2Yi6u4iQ0aIoaWpNUS7oPKHSJ6qATOT1SszjTfeiwppjvR4QDvP6TTnO4+AapFez7R5h rRZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=RQ16tyMh; 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 d22si785484oos.47.2020.03.24.07.26.59; Tue, 24 Mar 2020 07:27:12 -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=RQ16tyMh; 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 S1728557AbgCXOY5 (ORCPT + 99 others); Tue, 24 Mar 2020 10:24:57 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:36240 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728475AbgCXOYx (ORCPT ); Tue, 24 Mar 2020 10:24:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-Id:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=BilAV98/xyLJ3rbbbATq+anaMYfZWr9rp+kix4JP/Vc=; b=RQ16tyMhg3v/DXDAtMI7QGZpKI E6D5YHlLu4jXeF2ogb56sXdPbd52pw/bGOStKLkgXZxt7kRQAgNY3C4jFTDPXitvXOMSfo3cY4RZ7 1qVdE/DpB7mLllNVKgpSk6D5m3lVb/tkKt5Pk8k3ScaR64a8Q0JuRDBGnUvl2DH07OUYH/dPMJ+8t XveGudeDx5jckhtCl0OucQ0yULa3odzlFZpTsZRDnWJFXAs065yTjwtCFS2uz9PCNxRCqYW7N8Jl6 k1SdP6bmQcK10VmATcpwZMDfa6Gem7z2vH9Z2iSPfX0COndo5Kji4cCFR1jwTE2XhXubPpeZ59/7V qqMS7MIg==; 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 1jGkTt-0001fd-KH; Tue, 24 Mar 2020 14:24:37 +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 0F19F307444; Tue, 24 Mar 2020 15:24:35 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id ED5BF286C13B0; Tue, 24 Mar 2020 15:24:34 +0100 (CET) Message-Id: <20200324142245.445253190@infradead.org> User-Agent: quilt/0.65 Date: Tue, 24 Mar 2020 14:56:06 +0100 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, jpoimboe@redhat.com, jeyu@kernel.org Subject: [RESEND][PATCH v3 03/17] module: Properly propagate MODULE_STATE_COMING failure References: <20200324135603.483964896@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: jeyu@kernel.org --- 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,