Re: [patch] pi-futex: futex_wake() lockup fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 1 Jul 2006 09:07:46 +0200
Ingo Molnar <[email protected]> wrote:

> Subject: pi-futex: futex_wake() lockup fix
> From: Ingo Molnar <[email protected]>
> 
> 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 <[email protected]>
> ---
>  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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux