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, 05 Aug 2009 15:04:12 -0700
From:	Darren Hart <dvhltc@...ibm.com>
To:	linux-rt-users@...r.kernel.org, linux-kernel@...r.kernel.org
CC:	tglx@...utronix.de, peterz@...radead.org, rostedt@...dmis.org,
	mingo@...e.hu, dino@...ibm.com, johnstul@...ibm.com,
	John Kacur <jkacur@...hat.com>
Subject: [PATCH 2/2][RT] Avoid deadlock in rt_mutex_start_proxy_lock()

In the event of a lock steal or owner died, rt_mutex_start_proxy_lock() will
give the rt_mutex to the waiting task, but it fails to release the wait_lock.
This leads to subsequent deadlocks when other tasks try to acquire the
rt_mutex.

I also removed a few extra blank lines that really spaced this routine out.
I must have been high on the \n when I wrote this originally...

Note: this is the -rt version, I'll send another for mainline.

Signed-off-by: Darren Hart <dvhltc@...ibm.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Ingo Molnar <mingo@...e.hu>
CC: Dinakar Guniguntala <dino@...ibm.com>
CC: John Stultz <johnstul@...ibm.com>
CC: John Kacur <jkacur@...hat.com>

Index: 2.6.31-rc4-rt1/kernel/rtmutex.c
===================================================================
--- 2.6.31-rc4-rt1.orig/kernel/rtmutex.c	2009-08-05 10:29:39.000000000 -0700
+++ 2.6.31-rc4-rt1/kernel/rtmutex.c	2009-08-05 11:10:22.000000000 -0700
@@ -1517,9 +1517,8 @@ int rt_mutex_start_proxy_lock(struct rt_
 	    try_to_steal_lock(lock, task, STEAL_NORMAL)) {
 		/* We got the lock for task. */
 		debug_rt_mutex_lock(lock);
-
 		rt_mutex_set_owner(lock, task, 0);
-
+		atomic_spin_unlock_irqrestore(&lock->wait_lock, flags);
 		rt_mutex_deadlock_account_lock(lock, task);
 		return 1;
 	}
@@ -1527,7 +1526,6 @@ int rt_mutex_start_proxy_lock(struct rt_
 	ret = task_blocks_on_rt_mutex(lock, waiter, task, detect_deadlock,
 				      flags);
 
-
 	if (ret && !waiter->task) {
 		/*
 		 * Reset the return value. We might have

-- 
Darren Hart
IBM Linux Technology Center
Real-Time Linux Team
--
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