lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 28 May 2015 11:37:17 +0930
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	mingo@...nel.org, mathieu.desnoyers@...icios.com, oleg@...hat.com,
	paulmck@...ux.vnet.ibm.com, torvalds@...ux-foundation.org,
	linux-kernel@...r.kernel.org, andi@...stfloor.org,
	rostedt@...dmis.org, tglx@...utronix.de, laijs@...fujitsu.com,
	linux@...izon.com
Subject: Re: [PATCH v5 00/10] latched RB-trees and __module_address()

Peter Zijlstra <peterz@...radead.org> writes:
> On Tue, Apr 14, 2015 at 12:27:05PM +0930, Rusty Russell wrote:

Hmm, this blows up:

> +static void module_assert_mutex_or_preempt(void)
> +{
> +#ifdef CONFIG_LOCKDEP
> +	if (!unlikely(debug_locks))
> +		return;
> +
> +	WARN_ON(!rcu_held_lock_sched_held() &&
> +		!lockdep_is_held(&module_mutex));

That's rcu_read_lock_sched_held, not rcu_held_lock_sched_held().

Also, your unlikely is weird and backwards.

I changed it as below, and folded.  It's in modules-next.

I'm now going to do some *actual* testing, and I'll go all Torvalds on
you if this spews warnings...

Cheers,
Rusty.

diff --git a/kernel/module.c b/kernel/module.c
index 4a89b88b4428..a15899e00ca9 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -113,10 +113,10 @@ static void module_assert_mutex(void)
 static void module_assert_mutex_or_preempt(void)
 {
 #ifdef CONFIG_LOCKDEP
-	if (!unlikely(debug_locks))
+	if (unlikely(!debug_locks))
 		return;
 
-	WARN_ON(!rcu_held_lock_sched_held() &&
+	WARN_ON(!rcu_read_lock_sched_held() &&
 		!lockdep_is_held(&module_mutex));
 #endif
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ