From nobody Thu Aug 6 19:47:51 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 4hGHrF0xgtz6n6DN for ; Thu, 06 Aug 2026 19:47:57 +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 4hGHrD6FnDz43b3 for ; Thu, 06 Aug 2026 19:47:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786045676; 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=ghu80eNpi2b8/3AVmC+zWvR6x1m5Ya0AYFLZ1FsLvKo=; b=HcoCjArDf9TsVtROdoFtNF5//Mm/tB5QDx1ORLXZQO3AcYnrambNolW7dLYMp5mXMGQKHO HsLA0Z1q5Nh49wBsv1j8A2ZjyZX4MnyDoR9DAlvqZmunKcRSFel80eMhByMY27zy+NzMcS b6P0rB7gHhaKa5+5ctsiFdUHctI+wcv8WoADLqR4p/Dn9mKWARSGkkoBimAMc4ebdC2mir mqODF8NuNN36yAAosZP6HAS2a26AcXNKguJlBuKj3OX2QGdHzJPtfKfjcHW/jU7ExOfRRy yk3rjbsEQuv0ouN596ZeStMKNh62E24yGLT37OT72SR7bBptHf3GEHyskvF0jA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786045676; a=rsa-sha256; cv=none; b=CkGmz0DSXW/rqZqIt7+KCbxMKtdLjyPzJ3UkdL4a+kNxn3yjoy79xCrKCPVR/D9ogq4M6l Huf8L1+4IdjXnnO9bE/m/gjSJRyRKKl+LtCVV1OEZ37Rx1k/sYbNr+sfl92O6rk2sp5v1v tNbfx6I+3j0n19KXP/SNUvgqAmQyBSamlSxWTxFBA8UQjU7zLppUTHuU32ObIbILC5IQ1R ZMenYIQPXEkRpZhbwV2JEddhXy4JppdtLok89h8T8HtnkO4Ly0mKVFuqNtSbbC6JldWHJC 9X0w+5BKvX2OdpG3tAdZX38c9rTkJcHfxFZi57m8CWrN0FR0zL3ysleuqLPelA== 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=1786045676; 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=ghu80eNpi2b8/3AVmC+zWvR6x1m5Ya0AYFLZ1FsLvKo=; b=gfmWCXmryrDvQKuujf/aGCOWBBMFf65yX6heLxtiFLrY2ZX4ZE8O2LhcpRpFmURPwBkb10 OQN6gbAMBmqqXSoSrEkrrw8enzUbJ3eWZBDDahZ1x6tgzCc4RG8ym+GUxhR2yB+lKyXklK R4xM/A4cV5T3JNd0p92nknPcsDLSGH6CjL9fmcqxeYalyaDuXKIH9NUzxB1OYQoGE5rVxk kYkseRLvq0hvkS4BscW2Njjoo8DapgG0u+XquDZOf5VJPhSB8WfdVhj8GX2X1KOgSOvfRf r5Xz0sT0JhBtyPdrIK74JihDZbid8vEq00M4i1mphgPxqE59LxqH/7EONor5Dg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hGHrD4yBrzbmb for ; Thu, 06 Aug 2026 19:47:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3de0d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 06 Aug 2026 19:47:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 6154eec89acb - stable/15 - 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/15 X-Git-Reftype: branch X-Git-Commit: 6154eec89acb3aa6561f2e8ba365115a8056591d Auto-Submitted: auto-generated Date: Thu, 06 Aug 2026 19:47:51 +0000 Message-Id: <6a74e4e7.3de0d.13533a53@gitrepo.freebsd.org> The branch stable/15 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6154eec89acb3aa6561f2e8ba365115a8056591d commit 6154eec89acb3aa6561f2e8ba365115a8056591d Author: Rick Macklem AuthorDate: 2026-08-04 15:55:24 +0000 Commit: Rick Macklem 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;