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:	Wed, 27 Jul 2011 16:34:14 +0200
From:	Maarten Lankhorst <m.b.lankhorst@...il.com>
To:	Thomas Gleixner <tglx@...utronix.de>
CC:	Darren Hart <dvhart@...ux.intel.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Steven Rostedt <rostedt@...dmis.org>
Subject: Re: rt_mutex: restore wait_lock init in __rt_mutex_init

On 07/27/2011 11:37 AM, Thomas Gleixner wrote:
> On Wed, 27 Jul 2011, Darren Hart wrote:
>
>> Without the raw_spin_lock_init(), the wait_lock does not get properly
>> initialized with CONFIG_DEBUG_SPINLOCK. This can manifest in a BUG() in the
>> futex requeue_pi path when the pi_state->pi_mutex->wait_lock fails the magic
>> test in rt_mutex_start_proxy_lock()->raw_spin_lock(&lock->wait_lock).
> That's actively wrong. You reinitialize the lock for all other cases
> which call this via rt_mutex_init(). There is a reason why I moved the
> spin lock initializer out of __rt_mutex_init() into
> rt_mutex_init(). The lock name stuff for lockdep ends up to be
> "lock->wait_lock" for all rt_mutexes, which is pretty useless when you
> have to analyze a lockdep splat. Thanks for finding it nevertheless.
>
> So the correct fix is:
>
> Index: linux-2.6/kernel/rtmutex.c
> ===================================================================
> --- linux-2.6.orig/kernel/rtmutex.c
> +++ linux-2.6/kernel/rtmutex.c
> @@ -1296,7 +1296,7 @@ EXPORT_SYMBOL_GPL(__rt_mutex_init);
>  void rt_mutex_init_proxy_locked(struct rt_mutex *lock,
>  				struct task_struct *proxy_owner)
>  {
> -	__rt_mutex_init(lock, NULL);
> +	rt_mutex_init(lock);
>  	debug_rt_mutex_proxy_lock(lock, proxy_owner);
>  	rt_mutex_set_owner(lock, proxy_owner);
>  	rt_mutex_deadlock_account_lock(lock, proxy_owner);
>
>  
Seems to work. I no longer get a warning from pulseaudio either.
Also darren, at least on fedora 15 glibc supports requeue_pi.
support for that is in nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_*.S

Cheers,
Maarten
--
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