From nobody Thu Aug 6 19:53:49 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hGHz13YYvz6n6jT for ; Thu, 06 Aug 2026 19:53:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hGHz12wSTz44qt for ; Thu, 06 Aug 2026 19:53:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786046029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Iy8HRq0/qEX4dNlEFmjfn9iKEEBN+Jj31TUHl3hGppA=; b=l6MyJmXSvJ/xzjM4kU2s1DgWduJ29Qdly7IKXZ7C+lXVWS50mED0mE5PbgfUx1S9kLqtKp iu0JKj0xRw183LhvvGPTlOpeiiUCACEBZNp6V4RULO+VcvrhIGs3Qd7nyHAo+wmJRcMZ0d CQaHRQl+jI3j8MF1wH3pPfXL1aqNODmiTZ1Q0CGJDNEvNoKNnT7Zv8xv8Sh14JYGrX/Wxl ROwBW06EJTORGdta1RjK1RS7atluJJjrOwt8HkHpEtv9BlpCDbMuqzO+/xDnm6rrip20j6 gZUE3vCFK6Ld+A1ld849yqK6yx02uRo+AJe1axY9Ilu2lWRi9xnAKI+rAuuo0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786046029; a=rsa-sha256; cv=none; b=MaEZhA1TZYVkTW4RuGRzBbab6c09nltwbcJVYbmoOy/1dUwyAG+esE+gf7zMtiS/pYWFj4 VpBF8eo0DOhXsN7wy5H+tlhVbvz4Q8u6oj5tcLGd71J8U3+wpkrSAFZldNtNyIpLw3xeAO 36vBBRIGfAHFZ1KOBQ1n7TmgvQ3SdgpNpW17cpbSzLmwca7moSoMZFCgfFd910WiwBzegA c5DEmp5X21It5Aa613TIhZyUruhmnm8ArUPqXAuxpIK570OmiiYL6d1d0vqCICUbrrKBog Dpi8BEHxHcdco1c9MsRQOD8pHi65K5gu1QjJ6uUH35NGFbdOe58ed/PLm5to7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786046029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Iy8HRq0/qEX4dNlEFmjfn9iKEEBN+Jj31TUHl3hGppA=; b=bPZCGABl6vr5IqPC65MaTPv1RiTyDXwhAIexXlcuPlJCUFUdOZdNuAhwz6/VzfyM+omcCG h3PTQHgQeB1r2Tcs3wX1mRDDdJefb/ExJ26ADNYXRUTbAK7MdSxOm0e7UTAe0lwbhL5Mtx iXoJ987gODeazcSNERugirCVER52XZSCr2J5rRNr5oIfjvN0SE2H0hssTPzwggB1rRS+UJ b+uOuHx4wG2yA4VNN53xMJ5PwDWlKHPIJMNhpJYvE1a0I5BD1h7tGkIr/OhvjEvNEo2b+H QVhl9iKMLbAiINJtwyJP3uqDM7TqcSN+G+2vdudYDardYbMv3fiDo1Vf6iQt1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hGHz11NQKzbbH for ; Thu, 06 Aug 2026 19:53:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3da46 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 06 Aug 2026 19:53:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: bdea6e971844 - stable/14 - nfs_commonkrpc.c: Get rid of NFSv4.0 delegation cruft List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bdea6e971844ac2e0a3dfab47fc6e678a11e5d19 Auto-Submitted: auto-generated Date: Thu, 06 Aug 2026 19:53:49 +0000 Message-Id: <6a74e64d.3da46.e2770c3@gitrepo.freebsd.org> The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=bdea6e971844ac2e0a3dfab47fc6e678a11e5d19 commit bdea6e971844ac2e0a3dfab47fc6e678a11e5d19 Author: Rick Macklem AuthorDate: 2026-08-04 15:55:24 +0000 Commit: Rick Macklem CommitDate: 2026-08-06 19:52:36 +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 755372d51a68..b704169dbaab 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -727,33 +727,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;