History

Merge tag 'nfs-for-4.13-4' of git://git.linux-nfs.org/projects/anna/linux-nfs

Pull NFS client fixes from Anna Schumaker: "Two fixes from Trond this time, now that he's back from his vacation. The first is a stable fix for the EXCHANGE_ID issue on the mailing list, and the other fixes a double-free situation that he found at the same time. Stable fix: - Fix EXCHANGE_ID corrupt verifier issue Other fix: - Fix double frees in nfs4_test_session_trunk()" * tag 'nfs-for-4.13-4' of git://git.linux-nfs.org/projects/anna/linux-nfs: NFSv4: Fix double frees in nfs4_test_session_trunk() NFSv4: Fix EXCHANGE_ID corrupt verifier issue

Linus Torvalds committed 9 years ago

Commit 19ec50a2 parents 9f5af54 d9cb7334 files · +9 −25Browse files

Unified · Split

4 files
  1. fs/nfs/nfs4client.c +0 −3
  2. fs/nfs/nfs4proc.c +7 −20
  3. fs/nfs/nfs4xdr.c +1 −1
  4. include/linux/nfs_xdr.h +1 −1
fs/nfs/nfs4client.c+0−3
@@ -660,9 +660,6 @@ int nfs4_detect_session_trunking(struct nfs_client *clp, · 659 unmodified lines
660 if (!nfs4_check_server_scope(clp->cl_serverscope, res->server_scope))660 if (!nfs4_check_server_scope(clp->cl_serverscope, res->server_scope))
661 goto out_err;661 goto out_err;
662 662
663 /* Session trunking passed, add the xprt */
664 rpc_clnt_xprt_switch_add_xprt(clp->cl_rpcclient, xprt);
665
666 pr_info("NFS: %s: Session trunking succeeded for %s\n",663 pr_info("NFS: %s: Session trunking succeeded for %s\n",
667 clp->cl_hostname,664 clp->cl_hostname,
668 xprt->address_strings[RPC_DISPLAY_ADDR]);665 xprt->address_strings[RPC_DISPLAY_ADDR]);
fs/nfs/nfs4proc.c+7−20
@@ -7461,7 +7461,7 @@ static void nfs4_exchange_id_done(struct rpc_task *task, void *data) · 7460 unmodified lines
7461 cdata->res.server_scope = NULL;7461 cdata->res.server_scope = NULL;
7462 }7462 }
7463 /* Save the EXCHANGE_ID verifier session trunk tests */7463 /* Save the EXCHANGE_ID verifier session trunk tests */
7464 memcpy(clp->cl_confirm.data, cdata->args.verifier->data,7464 memcpy(clp->cl_confirm.data, cdata->args.verifier.data,
7465 sizeof(clp->cl_confirm.data));7465 sizeof(clp->cl_confirm.data));
7466 }7466 }
7467out:7467out:
@@ -7474,10 +7474,6 @@ static void nfs4_exchange_id_release(void *data) · 6 unmodified lines
7474 struct nfs41_exchange_id_data *cdata =7474 struct nfs41_exchange_id_data *cdata =
7475 (struct nfs41_exchange_id_data *)data;7475 (struct nfs41_exchange_id_data *)data;
7476 7476
7477 if (cdata->xprt) {
7478 xprt_put(cdata->xprt);
7479 rpc_clnt_xprt_switch_put(cdata->args.client->cl_rpcclient);
7480 }
7481 nfs_put_client(cdata->args.client);7477 nfs_put_client(cdata->args.client);
7482 kfree(cdata->res.impl_id);7478 kfree(cdata->res.impl_id);
7483 kfree(cdata->res.server_scope);7479 kfree(cdata->res.server_scope);
@@ -7498,7 +7494,6 @@ static const struct rpc_call_ops nfs4_exchange_id_call_ops = { · 14 unmodified lines
7498static int _nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred,7494static int _nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred,
7499 u32 sp4_how, struct rpc_xprt *xprt)7495 u32 sp4_how, struct rpc_xprt *xprt)
7500{7496{
7501 nfs4_verifier verifier;
7502 struct rpc_message msg = {7497 struct rpc_message msg = {
7503 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_EXCHANGE_ID],7498 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_EXCHANGE_ID],
7504 .rpc_cred = cred,7499 .rpc_cred = cred,
@@ -7507,7 +7502,7 @@ static int _nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred, · 2 unmodified lines
7507 .rpc_client = clp->cl_rpcclient,7502 .rpc_client = clp->cl_rpcclient,
7508 .callback_ops = &nfs4_exchange_id_call_ops,7503 .callback_ops = &nfs4_exchange_id_call_ops,
7509 .rpc_message = &msg,7504 .rpc_message = &msg,
7510 .flags = RPC_TASK_ASYNC | RPC_TASK_TIMEOUT,7505 .flags = RPC_TASK_TIMEOUT,
7511 };7506 };
7512 struct nfs41_exchange_id_data *calldata;7507 struct nfs41_exchange_id_data *calldata;
7513 struct rpc_task *task;7508 struct rpc_task *task;
@@ -7522,8 +7517,7 @@ static int _nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred, · 8 unmodified lines
7522 return -ENOMEM;7517 return -ENOMEM;
7523 }7518 }
7524 7519
7525 if (!xprt)7520 nfs4_init_boot_verifier(clp, &calldata->args.verifier);
7526 nfs4_init_boot_verifier(clp, &verifier);
7527 7521
7528 status = nfs4_init_uniform_client_string(clp);7522 status = nfs4_init_uniform_client_string(clp);
7529 if (status)7523 if (status)
@@ -7562,11 +7556,9 @@ static int _nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred, · 32 unmodified lines
7562 if (xprt) {7556 if (xprt) {
7563 calldata->xprt = xprt;7557 calldata->xprt = xprt;
7564 task_setup_data.rpc_xprt = xprt;7558 task_setup_data.rpc_xprt = xprt;
7565 task_setup_data.flags =7559 task_setup_data.flags |= RPC_TASK_SOFTCONN;
7566 RPC_TASK_SOFT|RPC_TASK_SOFTCONN|RPC_TASK_ASYNC;7560 memcpy(calldata->args.verifier.data, clp->cl_confirm.data,
7567 calldata->args.verifier = &clp->cl_confirm;7561 sizeof(calldata->args.verifier.data));
7568 } else {
7569 calldata->args.verifier = &verifier;
7570 }7562 }
7571 calldata->args.client = clp;7563 calldata->args.client = clp;
7572#ifdef CONFIG_NFS_V4_1_MIGRATION7564#ifdef CONFIG_NFS_V4_1_MIGRATION
@@ -7585,12 +7577,7 @@ static int _nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred, · 12 unmodified lines
7585 if (IS_ERR(task))7577 if (IS_ERR(task))
7586 return PTR_ERR(task);7578 return PTR_ERR(task);
7587 7579
7588 if (!xprt) {7580 status = calldata->rpc_status;
7589 status = rpc_wait_for_completion_task(task);
7590 if (!status)
7591 status = calldata->rpc_status;
7592 } else /* session trunking test */
7593 status = calldata->rpc_status;
7594 7581
7595 rpc_put_task(task);7582 rpc_put_task(task);
7596out:7583out:
fs/nfs/nfs4xdr.c+1−1
@@ -1785,7 +1785,7 @@ static void encode_exchange_id(struct xdr_stream *xdr, · 1784 unmodified lines
1785 int len = 0;1785 int len = 0;
1786 1786
1787 encode_op_hdr(xdr, OP_EXCHANGE_ID, decode_exchange_id_maxsz, hdr);1787 encode_op_hdr(xdr, OP_EXCHANGE_ID, decode_exchange_id_maxsz, hdr);
1788 encode_nfs4_verifier(xdr, args->verifier);1788 encode_nfs4_verifier(xdr, &args->verifier);
1789 1789
1790 encode_string(xdr, strlen(args->client->cl_owner_id),1790 encode_string(xdr, strlen(args->client->cl_owner_id),
1791 args->client->cl_owner_id);1791 args->client->cl_owner_id);
include/linux/nfs_xdr.h+1−1
@@ -1235,7 +1235,7 @@ struct nfs41_state_protection { · 1234 unmodified lines
1235 1235
1236struct nfs41_exchange_id_args {1236struct nfs41_exchange_id_args {
1237 struct nfs_client *client;1237 struct nfs_client *client;
1238 nfs4_verifier *verifier;1238 nfs4_verifier verifier;
1239 u32 flags;1239 u32 flags;
1240 struct nfs41_state_protection state_protect;1240 struct nfs41_state_protection state_protect;
1241};1241};