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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f7d9194b-6681-48f0-b5e9-11f43d2849bd@collabora.com>
Date:   Mon, 6 Dec 2021 09:12:11 -0300
From:   André Almeida <andrealmeid@...labora.com>
To:     6812skiii@...il.com
Cc:     peterz@...radead.org, mingo@...hat.com, tglx@...utronix.de,
        dvhart@...radead.org, dave@...olabs.net,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] futex: Fix a faulty comment.

Hi Jangwoong,

Thanks for your patch! However...

Às 15:14 de 04/12/21, 6812skiii@...il.com escreveu:
> From: Jangwoong Kim <6812skiii@...il.com>
> 
> We return 1, not the index of futex woken up.
> 
> Signed-off-by: Jangwoong Kim <6812skiii@...il.com>
> ---
>  kernel/futex/waitwake.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/futex/waitwake.c b/kernel/futex/waitwake.c
> index 4ce0923f1ce3..d148e5d4956b 100644
> --- a/kernel/futex/waitwake.c
> +++ b/kernel/futex/waitwake.c
> @@ -455,8 +455,8 @@ static int futex_wait_multiple_setup(struct futex_vector *vs, int count, int *wo
>  
>  		/*
>  		 * Even if something went wrong, if we find out that a futex
> -		 * was woken, we don't return error and return this index to
> -		 * userspace
> +		 * was woken, we don't return error and make userspace aware
> +		 * of this by returning 1.

We return to userspace the value at *woken, so your fix is wrong. Have a
look at futex_wait_multiple():

		ret = futex_wait_multiple_setup(vs, count, &hint);
		if (ret) {
			if (ret > 0) {
				/* A futex was woken during setup */
				ret = hint;
			}
			return ret;
		}

When we return 1 at futex_wait_multiple_setup(), we end up returning the
hint/woken value to userspace.

Let me know if you have questions.

	André

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ