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: <YuzFrzrTnTtUHMn/@sol.localdomain>
Date:   Fri, 5 Aug 2022 00:24:31 -0700
From:   Eric Biggers <ebiggers@...nel.org>
To:     Siddh Raman Pant <code@...dh.me>
Cc:     christophe.jaillet@...adoo.fr, corbet@....net, dhowells@...hat.com,
        edumazet@...gle.com,
        linux-kernel-mentees@...ts.linuxfoundation.org,
        linux-kernel@...r.kernel.org, mchehab@...nel.org,
        rdunlap@...radead.org
Subject: Re: [PATCH v2 3/3] kernel/watch_queue: Remove wqueue->defunct and
 use pipe for clear check

On Thu, Aug 04, 2022 at 08:11:52PM +0530, Siddh Raman Pant wrote:
>  static inline bool lock_wqueue(struct watch_queue *wqueue)
>  {
>  	spin_lock_bh(&wqueue->lock);
> -	if (unlikely(wqueue->defunct)) {
> +	if (unlikely(!READ_ONCE(wqueue->pipe))) {
>  		spin_unlock_bh(&wqueue->lock);
>  		return false;
>  	}

Why is the READ_ONCE() needed?  Doesn't wqueue->lock protect wqueue->pipe?

> +	/* This pipe will get freed by the caller free_pipe_info().
> +	 * Removing this reference also prevents new notifications.
> +	 */

This isn't the correct block comment format; it should look like:

	/*
	 * This pipe will get freed by the caller free_pipe_info().
	 * Removing this reference also prevents new notifications.
	 */

- Eric

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ