From: Andrew Morton <akpm@osdl.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org,
davej@redhat.com, tglx@linutronix.de, drepper@redhat.com
Subject: Re: [patch] pi-futex: futex_wake() lockup fix
Date: Sat, 1 Jul 2006 00:23:05 -0700 [thread overview]
Message-ID: <20060701002305.7b6b78a4.akpm@osdl.org> (raw)
In-Reply-To: <20060701070746.GA22457@elte.hu>
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?
next prev parent reply other threads:[~2006-07-01 7:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-01 7:07 [patch] pi-futex: futex_wake() lockup fix Ingo Molnar
2006-07-01 7:23 ` Andrew Morton [this message]
2006-07-01 7:25 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060701002305.7b6b78a4.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=davej@redhat.com \
--cc=drepper@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.