[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-stable-commits
Subject: patch rt-mutex-fix-stale-return-value.patch queued to 2.6.21-stable tree
From: chrisw () sous-sol ! org
Date: 2007-06-11 23:48:22
Message-ID: 200706112348.l5BNmM2n000714 () sous-sol ! org
[Download RAW message or body]
This is a note to let you know that we have just queued up the patch titled
Subject: rt-mutex: Fix stale return value
to the 2.6.21-stable tree. Its filename is
rt-mutex-fix-stale-return-value.patch
A git repo of this tree can be found at
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
>From stable-bounces@linux.kernel.org Fri Jun 8 03:16:12 2007
Message-Id: <20070608101735.036883282@inhelltoy.tec.linutronix.de>
Date: Fri, 08 Jun 2007 10:29:28 -0000
From: Thomas Gleixner <tglx@linutronix.de>
To: stable@kernel.org
Cc: kuznet@ms2.inr.ac.ru, mingo@elte.hu
Subject: rt-mutex: Fix stale return value
Alexey Kuznetsov found some problems in the pi-futex code.
The major problem is a stale return value in rt_mutex_slowlock():
When the pi chain walk returns -EDEADLK, but the waiter was woken up
during the phases where the locks were dropped, the rtmutex could be
acquired, but due to the stale return value -EDEADLK returned to the
caller.
Reset the return value in the woken up path.
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
---
kernel/rtmutex.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
--- linux-2.6.21.5.orig/kernel/rtmutex.c
+++ linux-2.6.21.5/kernel/rtmutex.c
@@ -659,9 +659,16 @@ rt_mutex_slowlock(struct rt_mutex *lock,
* all over without going into schedule to try
* to get the lock now:
*/
- if (unlikely(!waiter.task))
+ if (unlikely(!waiter.task)) {
+ /*
+ * Reset the return value. We might
+ * have returned with -EDEADLK and the
+ * owner released the lock while we
+ * were walking the pi chain.
+ */
+ ret = 0;
continue;
-
+ }
if (unlikely(ret))
break;
}
Patches currently in stable-queue which might be from tglx@linutronix.de are
queue-2.6.21/pi-futex-fix-exit-races-and-locking-problems.patch
queue-2.6.21/rt-mutex-fix-chain-walk-early-wakeup-bug.patch
queue-2.6.21/fix-show_mem-x86_64-sparsemem.patch
queue-2.6.21/rt-mutex-fix-stale-return-value.patch
-
To unsubscribe from this list: send the line "unsubscribe stable-commits" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic