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]
Date:	Wed, 19 Sep 2012 04:39:30 +0100
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Herton Ronaldo Krzesinski <herton.krzesinski@...onical.com>,
	Trond Myklebust <Trond.Myklebust@...app.com>
Cc:	linux-kernel@...r.kernel.org, stable@...r.kernel.org,
	torvalds@...ux-foundation.org, akpm@...ux-foundation.org,
	alan@...rguk.ukuu.org.uk, Weston Andros Adamson <dros@...app.com>
Subject: Re: [ 117/135] NFS: return error from decode_getfh in decode open

On Tue, 2012-09-18 at 22:26 -0300, Herton Ronaldo Krzesinski wrote:
> On Mon, Sep 17, 2012 at 01:38:22AM +0100, Ben Hutchings wrote:
> > 3.2-stable review patch.  If anyone has any objections, please let me know.
> > 
> > I'm not sure whether my expansion of the fix is correct here.
> > 
> > ------------------
> > 
> > From: Weston Andros Adamson <dros@...app.com>
> > 
> > commit 01913b49cf1dc6409a07dd2a4cc6af2e77f3c410 upstream.
> > 
> > If decode_getfh failed, nfs4_xdr_dec_open would return 0 since the last
> > decode_* call must have succeeded.
> > 
> > Signed-off-by: Weston Andros Adamson <dros@...app.com>
> > Signed-off-by: Trond Myklebust <Trond.Myklebust@...app.com>
> > [bwh: Backported to 3.2: this function makes two more function calls
> >  (no longer present in mainline) with the same issue, so fix them up
> >  similarly.]
> > Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
> > ---
> >  fs/nfs/nfs4xdr.c |    3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > --- a/fs/nfs/nfs4xdr.c
> > +++ b/fs/nfs/nfs4xdr.c
> > @@ -6113,12 +6113,15 @@ static int nfs4_xdr_dec_open(struct rpc_
> >  	status = decode_open(xdr, res);
> >  	if (status)
> >  		goto out;
> > -	if (decode_getfh(xdr, &res->fh) != 0)
> > +	status = decode_getfh(xdr, &res->fh);
> > +	if (status)
> >  		goto out;
> > -	if (decode_getfattr(xdr, res->f_attr, res->server,
> > -				!RPC_IS_ASYNC(rqstp->rq_task)) != 0)
> > +	status = decode_getfattr(xdr, res->f_attr, res->server,
> > +				 !RPC_IS_ASYNC(rqstp->rq_task));
> 
> I'm also not sure about the expansion of the fix here, not knowing very
> much about nfs. It seems that the code in some cases want to discard the
> status from decode_getfattr, for example nfs4_xdr_dec_rename is one case
> which does the same. Is it ok to return the status of decode_getfattr on
> nfs4_xdr_dec_open here? Or should it remain like it was before?

It looks like we try to get the file and directory attributes, and those
are nice to have but the open operation is still successful even if we
can't get them.  So my extra 'fixes' here are wrong.  Trond, is this
right?

Ben.

> > +	if (status)
> >  		goto out;
> > -	if (decode_restorefh(xdr) != 0)
> > +	status = decode_restorefh(xdr);
> > +	if (status)
> >  		goto out;
> >  	decode_getfattr(xdr, res->dir_attr, res->server,
> >  			!RPC_IS_ASYNC(rqstp->rq_task));
> 

-- 
Ben Hutchings
The world is coming to an end.	Please log off.

Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ