The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Theodore Tso <tytso@mit.edu>
Subject: Re: [patch] futex: PI state locking fix
Date: Mon, 12 Mar 2007 10:28:28 +0100	[thread overview]
Message-ID: <1173691708.13341.60.camel@localhost.localdomain> (raw)
In-Reply-To: <20070312091342.GA27425@elte.hu>

On Mon, 2007-03-12 at 10:13 +0100, Ingo Molnar wrote:
> Subject: [patch] futex: PI state locking fix
> From: Ingo Molnar <mingo@elte.hu>
> 
> testing of -rt by IBM uncovered a locking bug in wake_futex_pi(): the PI 
> state needs to be locked before we access it.
> 
> this patch has been tested in -rt. Must-have for v2.6.21.
> 
> Signed-off-by: Ingo Molnar <mingo@elte.hu>

Acked-by: Thomas Gleixner <tglx@linutronix.de>

> --
>  kernel/futex.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> Index: linux/kernel/futex.c
> ===================================================================
> --- linux.orig/kernel/futex.c
> +++ linux/kernel/futex.c
> @@ -566,6 +566,7 @@ static int wake_futex_pi(u32 __user *uad
>  	if (!pi_state)
>  		return -EINVAL;
>  
> +	spin_lock(&pi_state->pi_mutex.wait_lock);
>  	new_owner = rt_mutex_next_owner(&pi_state->pi_mutex);
>  
>  	/*
> @@ -605,6 +606,7 @@ static int wake_futex_pi(u32 __user *uad
>  	pi_state->owner = new_owner;
>  	spin_unlock_irq(&new_owner->pi_lock);
>  
> +	spin_unlock(&pi_state->pi_mutex.wait_lock);
>  	rt_mutex_unlock(&pi_state->pi_mutex);
>  
>  	return 0;


  reply	other threads:[~2007-03-12 10:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-12  9:13 [patch] futex: PI state locking fix Ingo Molnar
2007-03-12  9:28 ` Thomas Gleixner [this message]
2007-03-12 14:44 ` Chuck Ebbert
2007-03-12 14:45   ` 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=1173691708.13341.60.camel@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox