lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150219095637.GA344@gmail.com>
Date:	Thu, 19 Feb 2015 10:56:37 +0100
From:	Ingo Molnar <mingo@...nel.org>
To:	Davidlohr Bueso <dave@...olabs.net>
Cc:	tglx@...utronix.de, peterz@...radead.org, dvhart@...ux.intel.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] futex: Robustify wake_futex()


* Davidlohr Bueso <dave@...olabs.net> wrote:

> @@ -1674,13 +1689,19 @@ retry_private:
>  		}
>  
>  		/*
> -		 * Wake nr_wake waiters.  For requeue_pi, if we acquired the
> -		 * lock, we already woke the top_waiter.  If not, it will be
> -		 * woken by futex_unlock_pi().
> +		 * For requeue_pi, if we acquired the lock, we already woke
> +		 * the top_waiter. If not, it will be woken by futex_unlock_pi.
> +		 *
> +		 * The regular (non-pi) case is much simpler: Wake the top
> +		 * waiter (next in line) and repeat.
>  		 */
> -		if (++task_count <= nr_wake && !requeue_pi) {
> -			wake_futex(this);
> -			continue;
> +		if (!requeue_pi) {
> +			if (!wake_futex(this)) {
> +				ret = -EINVAL;
> +				break;
> +			}
> +			if (++task_count <= nr_wake)
> +				continue;
>  		}
>  

Hm, so at a first glance this change appears to go beyond 
the scope of adding a return value to wake_futex()?

For example before the change in the !requeue_pi case we'd 
only call wake_futex() if ++task_count <= nr_wake, after 
the change we always call it.

What's the intention here?

Thanks,

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ