Date: Thu, 06 Aug 2026 19:47:51 +0000 From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 6154eec89acb - stable/15 - nfs_commonkrpc.c: Get rid of NFSv4.0 delegation cruft Message-ID: <6a74e4e7.3de0d.13533a53@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6154eec89acb3aa6561f2e8ba365115a8056591d commit 6154eec89acb3aa6561f2e8ba365115a8056591d Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2026-08-04 15:55:24 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2026-08-06 19:46:22 +0000 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 (cherry picked from commit 8f20299b473af6132e0f146d7f634640993aeb81) --- sys/fs/nfsclient/nfs_clrpcops.c | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 43fc0af299b1..dc42170e0577 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -731,33 +731,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;home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a74e4e7.3de0d.13533a53>
