mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
nfs_commonkrpc.c: Get rid of NFSv4.0 delegation cruft
Delegations in NFSv4.0 never worked well and, since the NFSv4.0 protocol is now deprecated, use of delegations for NFSv4.0 is disabled as far as the client can do so. It turns out that some Illumos NFSv4.0 server issues delegations anyhow (even when the callback path is specified as 0.0.0.0) and this can cause use after free problems. This patch deleted some cruft that did an nfsrpc_openrpc() call recursively when an NFSv4.0 server failed to issue a delegation when it had previously done so. This code was only meant to be an optimization and would have been rarely exercised. Since this recursive call of nfsrpc_openrpc() is in some of the backtraces in the bugzilla PR, getting rid of the cruft makes sense. It is not known if this helps w.r.t. the use after free problems at this time. PR: 297233 MFC after: 3 days
This commit is contained in:
1 parent
82c013fb59
commit
8f20299b47
1 file changed
-27
@@ -735,33 +735,6 @@ nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen,
|
||||
else
|
||||
op->nfso_posixlock = 0;
|
||||
|
||||
/*
|
||||
* If the server is handing out delegations, but we didn't
|
||||
* get one because an OpenConfirm was required, try the
|
||||
* Open again, to get a delegation. This is a harmless no-op,
|
||||
* from a server's point of view.
|
||||
*/
|
||||
if (!reclaim && (rflags & NFSV4OPEN_RESULTCONFIRM) &&
|
||||
(op->nfso_own->nfsow_clp->nfsc_flags & NFSCLFLAGS_GOTDELEG)
|
||||
&& !error && dp == NULL && ndp == NULL && !recursed) {
|
||||
do {
|
||||
ret = nfsrpc_openrpc(nmp, vp, nfhp, fhlen, newfhp,
|
||||
newfhlen, mode, op, name, namelen, &ndp, 0, 0x0,
|
||||
cred, p, syscred, 1);
|
||||
if (ret == NFSERR_DELAY)
|
||||
(void) nfs_catnap(PZERO, ret, "nfs_open2");
|
||||
} while (ret == NFSERR_DELAY);
|
||||
if (ret) {
|
||||
if (ndp != NULL) {
|
||||
free(ndp, M_NFSCLDELEG);
|
||||
ndp = NULL;
|
||||
}
|
||||
if (ret == NFSERR_STALECLIENTID ||
|
||||
ret == NFSERR_STALEDONTRECOVER ||
|
||||
ret == NFSERR_BADSESSION)
|
||||
error = ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nd->nd_repstat != 0 && error == 0)
|
||||
error = nd->nd_repstat;
|
||||
|
||||
Reference in new issue
Block a user