public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@primarydata.com>
To: Adamson Weston Andros <dros@primarydata.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/2] nfs4: fix discover_server_trunking use after free
Date: Mon, 20 Jan 2014 16:32:59 -0700	[thread overview]
Message-ID: <D87D3ADC-94A0-438D-AADD-4139C70AE3B3@primarydata.com> (raw)
In-Reply-To: <1390189537-9666-1-git-send-email-dros@primarydata.com>


On Jan 19, 2014, at 20:45, Weston Andros Adamson <dros@primarydata.com> wrote:

> If clp is new (cl_count = 1) and it matches another client in
> nfs4_discover_server_trunking, the nfs_put_client will free clp before
> ->cl_preserve_clid is set.
> 
> Cc: stable@vger.kernel.org # 3.7+
> Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
> ---
> fs/nfs/nfs4client.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
> index c1b7a80..0f9b772 100644
> --- a/fs/nfs/nfs4client.c
> +++ b/fs/nfs/nfs4client.c
> @@ -414,11 +414,12 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp,
> 	error = nfs4_discover_server_trunking(clp, &old);
> 	if (error < 0)
> 		goto error;
> -	nfs_put_client(clp);
> -	if (clp != old) {
> +
> +	if (clp != old)
> 		clp->cl_preserve_clid = true;
> +	nfs_put_client(clp);
> +	if (clp != old)
> 		clp = old;
> -	}
> 

Applied, but I cleaned it up by replacing the last 2 lines with an equivalent ‘return old’...

--
Trond Myklebust
Linux NFS client maintainer


  parent reply	other threads:[~2014-01-20 23:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1390189537-9666-1-git-send-email-dros@primarydata.com>
2014-01-20  3:45 ` [PATCH 2/2] nfs4: fix comments in discover_server_trunking Weston Andros Adamson
2014-01-20  4:20   ` Weston Andros Adamson
2014-01-20 23:32 ` Trond Myklebust [this message]
2014-01-21 15:04   ` [PATCH 1/2] nfs4: fix discover_server_trunking use after free Weston Andros Adamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D87D3ADC-94A0-438D-AADD-4139C70AE3B3@primarydata.com \
    --to=trond.myklebust@primarydata.com \
    --cc=dros@primarydata.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox