From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754890AbbCBTij (ORCPT ); Mon, 2 Mar 2015 14:38:39 -0500 Received: from e37.co.us.ibm.com ([32.97.110.158]:52032 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753943AbbCBTih (ORCPT ); Mon, 2 Mar 2015 14:38:37 -0500 Date: Mon, 2 Mar 2015 11:38:31 -0800 From: "Paul E. McKenney" To: Peter Zijlstra Cc: mingo@kernel.org, rusty@rustcorp.com.au, mathieu.desnoyers@efficios.com, oleg@redhat.com, linux-kernel@vger.kernel.org, andi@firstfloor.org, rostedt@goodmis.org, tglx@linutronix.de Subject: Re: [RFC][PATCH 3/9] module: Annotate module version magic Message-ID: <20150302193831.GT15405@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20150228212447.381543289@infradead.org> <20150228213110.010715367@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150228213110.010715367@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15030219-0025-0000-0000-000008FC0923 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 28, 2015 at 10:24:50PM +0100, Peter Zijlstra wrote: > Due to the new lockdep checks we go: > > [ 9.759380] ------------[ cut here ]------------ > [ 9.759389] WARNING: CPU: 31 PID: 597 at ../kernel/module.c:216 each_symbol_section+0x121/0x130() > [ 9.759391] Modules linked in: > [ 9.759393] CPU: 31 PID: 597 Comm: modprobe Not tainted 4.0.0-rc1+ #65 > [ 9.759393] Hardware name: Intel Corporation S2600GZ/S2600GZ, BIOS SE5C600.86B.02.02.0002.122320131210 12/23/2013 > [ 9.759396] ffffffff817d8676 ffff880424567ca8 ffffffff8157e98b 0000000000000001 > [ 9.759398] 0000000000000000 ffff880424567ce8 ffffffff8105fbc7 ffff880424567cd8 > [ 9.759400] 0000000000000000 ffffffff810ec160 ffff880424567d40 0000000000000000 > [ 9.759400] Call Trace: > [ 9.759407] [] dump_stack+0x4f/0x7b > [ 9.759410] [] warn_slowpath_common+0x97/0xe0 > [ 9.759412] [] ? section_objs+0x60/0x60 > [ 9.759414] [] warn_slowpath_null+0x1a/0x20 > [ 9.759415] [] each_symbol_section+0x121/0x130 > [ 9.759417] [] find_symbol+0x31/0x70 > [ 9.759420] [] load_module+0x20f/0x2660 > [ 9.759422] [] ? __do_page_fault+0x190/0x4e0 > [ 9.759426] [] ? retint_restore_args+0x13/0x13 > [ 9.759427] [] ? retint_restore_args+0x13/0x13 > [ 9.759433] [] ? trace_hardirqs_on_caller+0x11d/0x1e0 > [ 9.759437] [] ? trace_hardirqs_on_thunk+0x3a/0x3f > [ 9.759439] [] ? retint_restore_args+0x13/0x13 > [ 9.759441] [] SyS_init_module+0xce/0x100 > [ 9.759443] [] system_call_fastpath+0x12/0x17 > [ 9.759445] ---[ end trace 9294429076a9c644 ]--- > > As per the comment this site should be fine, but lets wrap it in > preempt_disable() anyhow to placate lockdep. > > Cc: Rusty Russell > Signed-off-by: Peter Zijlstra (Intel) Acked-by: Paul E. McKenney > --- > kernel/module.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > --- a/kernel/module.c > +++ b/kernel/module.c > @@ -1192,11 +1192,17 @@ static inline int check_modstruct_versio > { > const unsigned long *crc; > > - /* Since this should be found in kernel (which can't be removed), > - * no locking is necessary. */ > + /* > + * Since this should be found in kernel (which can't be removed), > + * no locking is necessary. > + */ > + preempt_disable(); > if (!find_symbol(VMLINUX_SYMBOL_STR(module_layout), NULL, > - &crc, true, false)) > + &crc, true, false)) { > + preempt_enable(); > BUG(); > + } > + preempt_enable(); > return check_version(sechdrs, versindex, > VMLINUX_SYMBOL_STR(module_layout), mod, crc, > NULL); > >