aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2017-04-04 15:32:07 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-12 06:41:17 -0400
commit607ca1dccbbd880b9f2bddfda23ec8aed1c5acbe (patch)
tree44585ee949c99064482246df3e063c86fc3e755f /net
parent3a87bcdebf6eeb094be139a42626edb7dce8c960 (diff)
svcauth_gss: Close connection when dropping an incoming message
[ Upstream commit 4d712ef1db05c3aa5c3b690a50c37ebad584c53f ] S5.3.3.1 of RFC 2203 requires that an incoming GSS-wrapped message whose sequence number lies outside the current window is dropped. The rationale is: The reason for discarding requests silently is that the server is unable to determine if the duplicate or out of range request was due to a sequencing problem in the client, network, or the operating system, or due to some quirk in routing, or a replay attack by an intruder. Discarding the request allows the client to recover after timing out, if indeed the duplication was unintentional or well intended. However, clients may rely on the server dropping the connection to indicate that a retransmit is needed. Without a connection reset, a client can wait forever without retransmitting, and the workload just stops dead. I've reproduced this behavior by running xfstests generic/323 on an NFSv4.0 mount with proto=rdma and sec=krb5i. To address this issue, have the server close the connection when it silently discards an incoming message due to a GSS sequence number problem. There are a few other places where the server will never reply. Change those spots in a similar fashion. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/auth_gss/svcauth_gss.c2
-rw-r--r--net/sunrpc/svc.c14
2 files changed, 10 insertions, 6 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 6fdffde28733..153082598522 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -1548,7 +1548,7 @@ complete:
1548 ret = SVC_COMPLETE; 1548 ret = SVC_COMPLETE;
1549 goto out; 1549 goto out;
1550drop: 1550drop:
1551 ret = SVC_DROP; 1551 ret = SVC_CLOSE;
1552out: 1552out:
1553 if (rsci) 1553 if (rsci)
1554 cache_put(&rsci->h, sn->rsc_cache); 1554 cache_put(&rsci->h, sn->rsc_cache);
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 7c8070ec93c8..75f290bddca1 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1155,8 +1155,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
1155 case SVC_DENIED: 1155 case SVC_DENIED:
1156 goto err_bad_auth; 1156 goto err_bad_auth;
1157 case SVC_CLOSE: 1157 case SVC_CLOSE:
1158 if (test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags)) 1158 goto close;
1159 svc_close_xprt(rqstp->rq_xprt);
1160 case SVC_DROP: 1159 case SVC_DROP:
1161 goto dropit; 1160 goto dropit;
1162 case SVC_COMPLETE: 1161 case SVC_COMPLETE:
@@ -1246,7 +1245,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
1246 1245
1247 sendit: 1246 sendit:
1248 if (svc_authorise(rqstp)) 1247 if (svc_authorise(rqstp))
1249 goto dropit; 1248 goto close;
1250 return 1; /* Caller can now send it */ 1249 return 1; /* Caller can now send it */
1251 1250
1252 dropit: 1251 dropit:
@@ -1254,11 +1253,16 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
1254 dprintk("svc: svc_process dropit\n"); 1253 dprintk("svc: svc_process dropit\n");
1255 return 0; 1254 return 0;
1256 1255
1256 close:
1257 if (test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags))
1258 svc_close_xprt(rqstp->rq_xprt);
1259 dprintk("svc: svc_process close\n");
1260 return 0;
1261
1257err_short_len: 1262err_short_len:
1258 svc_printk(rqstp, "short len %Zd, dropping request\n", 1263 svc_printk(rqstp, "short len %Zd, dropping request\n",
1259 argv->iov_len); 1264 argv->iov_len);
1260 1265 goto close;
1261 goto dropit; /* drop request */
1262 1266
1263err_bad_rpc: 1267err_bad_rpc:
1264 serv->sv_stats->rpcbadfmt++; 1268 serv->sv_stats->rpcbadfmt++;