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] [day] [month] [year] [list]
Message-ID: <20130311150208.GB16309@fieldses.org>
Date:	Mon, 11 Mar 2013 11:02:08 -0400
From:	"J. Bruce Fields" <bfields@...ldses.org>
To:	ycnian@...il.com
Cc:	linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] nfsd: fix bug on nfs4 stateid deallocation

On Mon, Mar 11, 2013 at 08:46:14AM +0800, ycnian@...il.com wrote:
> NFS4_OO_PURGE_CLOSE is not handled properly. To avoid memory leak, nfs4 
> stateid which is pointed by oo_last_closed_stid is freed in nfsd4_close(), 
> but NFS4_OO_PURGE_CLOSE isn't cleared meanwhile. So the stateid released in 
> THIS close procedure may be freed immediately in the coming encoding function.

OK, makes sense.  This code is confusing, I wonder if there's some way
we could make it simpler.

> Sorry that Signed-off-by was forgotten in last version.

Do you have a test that reproduces this bug?

--b.

> 
> Signed-off-by: Yanchuan Nian <ycnian@...il.com>
> ---
>  fs/nfsd/nfs4state.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index cc41bf4..d972db8 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -3827,6 +3827,7 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
>  
>  	nfsd4_close_open_stateid(stp);
>  	release_last_closed_stateid(oo);
> +	oo->oo_flags &= ~NFS4_OO_PURGE_CLOSE;
>  	oo->oo_last_closed_stid = stp;
>  
>  	if (list_empty(&oo->oo_owner.so_stateids)) {
> -- 
> 1.7.4.4
> 
--
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