lkml.org 
[lkml]   [2006]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] pi-futex: futex_wake() lockup fix
On Sat, 1 Jul 2006 09:07:46 +0200
Ingo Molnar <mingo@elte.hu> wrote:

> Subject: pi-futex: futex_wake() lockup fix
> From: Ingo Molnar <mingo@elte.hu>
>
> fix futex_wake() exit condition bug when handling the robust-list with
> PI futexes on them.
>
> (reported by Ulrich Drepper, debugged by the lock validator.)
>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---
> kernel/futex.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> Index: linux/kernel/futex.c
> ===================================================================
> --- linux.orig/kernel/futex.c
> +++ linux/kernel/futex.c
> @@ -646,8 +646,10 @@ static int futex_wake(u32 __user *uaddr,
>
> list_for_each_entry_safe(this, next, head, list) {
> if (match_futex (&this->key, &key)) {
> - if (this->pi_state)
> - return -EINVAL;
> + if (this->pi_state) {
> + ret = -EINVAL;
> + break;
> + }
> wake_futex(this);
> if (++ret >= nr_wake)
> break;

Well that was rather a howler.

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

\
 
 \ /
  Last update: 2006-07-02 00:09    [W:0.030 / U:5.672 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site