Commit 4d712ef1 authored by Chuck Lever's avatar Chuck Lever Committed by J. Bruce Fields

svcauth_gss: Close connection when dropping an incoming message

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: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 1b9f700b
...@@ -1548,7 +1548,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp) ...@@ -1548,7 +1548,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
ret = SVC_COMPLETE; ret = SVC_COMPLETE;
goto out; goto out;
drop: drop:
ret = SVC_DROP; ret = SVC_CLOSE;
out: out:
if (rsci) if (rsci)
cache_put(&rsci->h, sn->rsc_cache); cache_put(&rsci->h, sn->rsc_cache);
......
...@@ -1155,8 +1155,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv) ...@@ -1155,8 +1155,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
case SVC_DENIED: case SVC_DENIED:
goto err_bad_auth; goto err_bad_auth;
case SVC_CLOSE: case SVC_CLOSE:
if (test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags)) goto close;
svc_close_xprt(rqstp->rq_xprt);
case SVC_DROP: case SVC_DROP:
goto dropit; goto dropit;
case SVC_COMPLETE: case SVC_COMPLETE:
...@@ -1246,7 +1245,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv) ...@@ -1246,7 +1245,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
sendit: sendit:
if (svc_authorise(rqstp)) if (svc_authorise(rqstp))
goto dropit; goto close;
return 1; /* Caller can now send it */ return 1; /* Caller can now send it */
dropit: dropit:
...@@ -1254,11 +1253,16 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv) ...@@ -1254,11 +1253,16 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
dprintk("svc: svc_process dropit\n"); dprintk("svc: svc_process dropit\n");
return 0; return 0;
close:
if (test_bit(XPT_TEMP, &rqstp->rq_xprt->xpt_flags))
svc_close_xprt(rqstp->rq_xprt);
dprintk("svc: svc_process close\n");
return 0;
err_short_len: err_short_len:
svc_printk(rqstp, "short len %Zd, dropping request\n", svc_printk(rqstp, "short len %Zd, dropping request\n",
argv->iov_len); argv->iov_len);
goto close;
goto dropit; /* drop request */
err_bad_rpc: err_bad_rpc:
serv->sv_stats->rpcbadfmt++; serv->sv_stats->rpcbadfmt++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment