aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorWeston Andros Adamson <dros@primarydata.com>2014-01-19 22:45:36 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-13 16:48:01 -0500
commitdaab6e7df44ba7d4281379c6ac5780e10d133286 (patch)
tree56bc1ddb126e05f153a631a2c0d8817b235cc71b /fs
parent14ff66ce27e91666bf55e415104fdec9f9b18668 (diff)
nfs4: fix discover_server_trunking use after free
commit abad2fa5ba67725a3f9c376c8cfe76fbe94a3041 upstream. 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. Signed-off-by: Weston Andros Adamson <dros@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4client.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 3afae9059222..02773aab43c5 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -240,13 +240,11 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp,
240 error = nfs4_discover_server_trunking(clp, &old); 240 error = nfs4_discover_server_trunking(clp, &old);
241 if (error < 0) 241 if (error < 0)
242 goto error; 242 goto error;
243 nfs_put_client(clp);
244 if (clp != old) {
245 clp->cl_preserve_clid = true;
246 clp = old;
247 }
248 243
249 return clp; 244 if (clp != old)
245 clp->cl_preserve_clid = true;
246 nfs_put_client(clp);
247 return old;
250 248
251error: 249error:
252 nfs_mark_client_ready(clp, error); 250 nfs_mark_client_ready(clp, error);