Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-doc
Path: blob/main/website/static/security/patches/EN-10:01/nfsreconnect.patch
18096 views
1
Index: sys/rpc/clnt_vc.c
2
===================================================================
3
--- sys/rpc/clnt_vc.c (revision 200583)
4
+++ sys/rpc/clnt_vc.c (working copy)
5
@@ -413,6 +413,22 @@ call_again:
6
7
cr->cr_xid = xid;
8
mtx_lock(&ct->ct_lock);
9
+ /*
10
+ * Check to see if the other end has already started to close down
11
+ * the connection. The upcall will have set ct_error.re_status
12
+ * to RPC_CANTRECV if this is the case.
13
+ * If the other end starts to close down the connection after this
14
+ * point, it will be detected later when cr_error is checked,
15
+ * since the request is in the ct_pending queue.
16
+ */
17
+ if (ct->ct_error.re_status == RPC_CANTRECV) {
18
+ if (errp != &ct->ct_error) {
19
+ errp->re_errno = ct->ct_error.re_errno;
20
+ errp->re_status = RPC_CANTRECV;
21
+ }
22
+ stat = RPC_CANTRECV;
23
+ goto out;
24
+ }
25
TAILQ_INSERT_TAIL(&ct->ct_pending, cr, cr_link);
26
mtx_unlock(&ct->ct_lock);
27
28
29