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] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0907020941110.5905@makko.or.mcafeemobile.com>
Date:	Thu, 2 Jul 2009 09:43:23 -0700 (PDT)
From:	Davide Libenzi <davidel@...ilserver.org>
To:	Gregory Haskins <ghaskins@...ell.com>
cc:	kvm@...r.kernel.org,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	mst@...hat.com, avi@...hat.com
Subject: Re: [KVM PATCH v9 2/5] eventfd: use locked POLLHUP

On Thu, 2 Jul 2009, Gregory Haskins wrote:

> eventfd currently emits a POLLHUP wakeup on f_ops->release() to generate a
> "release" callback. This lets eventfd clients know if the eventfd is about
> to go away and is very useful particularly for in-kernel clients. However,
> as it stands today it is not possible to use this feature of eventfd in a
> race-free way. This patch changes the POLLHUP code to use the locked variant
> to rectify this problem.
> 
> Signed-off-by: Gregory Haskins <ghaskins@...ell.com>
> CC: Davide Libenzi <davidel@...ilserver.org>
> ---
> 
>  fs/eventfd.c |    7 +------
>  1 files changed, 1 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/eventfd.c b/fs/eventfd.c
> index d9849a1..31d12de 100644
> --- a/fs/eventfd.c
> +++ b/fs/eventfd.c
> @@ -105,12 +105,7 @@ static int eventfd_release(struct inode *inode, struct file *file)
>  {
>  	struct eventfd_ctx *ctx = file->private_data;
>  
> -	/*
> -	 * No need to hold the lock here, since we are on the file cleanup
> -	 * path and the ones still attached to the wait queue will be
> -	 * serialized by wake_up_locked_poll().
> -	 */
> -	wake_up_locked_poll(&ctx->wqh, POLLHUP);
> +	wake_up_poll(&ctx->wqh, POLLHUP);
>  	eventfd_ctx_put(ctx);
>  	return 0;
>  }

ACK.
BTW, mainline already has the correct wake_up_poll().


- Davide


--
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