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: <80670aa0fdb2b0c818a9217929e38df61fef1689.camel@hammerspace.com>
Date: Wed, 2 Apr 2025 13:56:28 +0000
From: Trond Myklebust <trondmy@...merspace.com>
To: "hch@....de" <hch@....de>, "dan.carpenter@...aro.org"
	<dan.carpenter@...aro.org>
CC: "anna@...nel.org" <anna@...nel.org>, "linux-nfs@...r.kernel.org"
	<linux-nfs@...r.kernel.org>, "sagi@...mberg.me" <sagi@...mberg.me>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH] nfs: Add missing release on error in
 nfs_lock_and_join_requests()

On Wed, 2025-04-02 at 14:02 +0300, Dan Carpenter wrote:
> Call nfs_release_request() on this error path before returning.
> 
> Fixes: c3f2235782c3 ("nfs: fold nfs_folio_find_and_lock_request into
> nfs_lock_and_join_requests")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
> From static analysis and untested.  Pretty sure it's correct,
> though.  ;)
> 
>  fs/nfs/write.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> index aa3d8bea3ec0..23df8b214474 100644
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -579,8 +579,10 @@ static struct nfs_page
> *nfs_lock_and_join_requests(struct folio *folio)
>  
>  	while (!nfs_lock_request(head)) {
>  		ret = nfs_wait_on_request(head);
> -		if (ret < 0)
> +		if (ret < 0) {
> +			nfs_release_request(head);
>  			return ERR_PTR(ret);
> +		}
>  	}
>  
>  	/* Ensure that nobody removed the request before we locked
> it */

Yep, that's a slam dunk. Thanks for spotting it!

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@...merspace.com


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ