From nobody Tue Nov 17 17:04:11 2026 X-Original-To: dev-commits-src-all@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 4jTWKl3vYhz71QyN for ; Tue, 17 Nov 2026 17:04:11 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jTWKl15NBz4FV7 for ; Tue, 17 Nov 2026 17:04:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cRpzFi63XjocC+vBjnH/DDLP+r2/jPCIUEOeXGBopSc=; b=yFDdh8GvrmztS5lX5gTPVHvebhCDYCbJ+OrObl5v8p1Li9mu9vGBkusrYzj6ZGIs/H4vPv zOIhMzDAjcfunbi5KHJms8+mfVVB7VACyOG6S0KpfJ+NY+4E6JXl0YnDsz10hsaMGH6QlX YJFmGKO3h+s1SCs+lcSVJSBl7rvSXDuAy8jEa5hZLp2BPFj1s9HhoXNd4MwzOvD0TO/6cp /E3+KiOaQxSl0M1ehzfvEkZONUjpuVrcsHVJDs9wc3dlV2+tPxoB9qmAF2gHmG/YXZpYMl NPg9cMQkhVz8Q1sgu1bZlUONt70rw3wPOL5X/FdkydFT5jRnFuAVbVJ1+i/MXw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794935051; b=oXbmN4b87US3Tm9rX8PluIiHwCVjSZZUEo8SIQUep4ApwaE3EfC2Xv0oJQYYdoC+kDNB21 C9bnzgVVl2j0LGXpqRNDuedU/dn5fk1nwkfuDbxr1ANholGwaEqVVeCUiLPJYVAoeE2I9f 6mX6yltnX7X0SBqhiz0lTW7p+n4xs50hrjlfqoId7NcRhotnlJgbNwKhNWEz0zvQX9oxMD 3zrcqQwfphZ6LhoHKeaaf1OGLatBU6FlIKoaJ0Bp4r+BwZKr3n1/TwsYEzvwJeBq0cSCJJ PTkTG+h3l7WT6CJLUYadMKtDTeZtEdc1X4a/YxQOXJ9oBv2rS6M0dnrSXqsuTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cRpzFi63XjocC+vBjnH/DDLP+r2/jPCIUEOeXGBopSc=; b=eJvmRlF8NDRqVqSLuNOcrSfHmieGCPIq6Nx6rIEcwAM8gEnqo48kGirtmqHekToC1XkpG4 wJaz3K0BVhmAJnohCQYU59OAgxKgaA+Qo5fy2d71+4kRjawSXZHxJqnAIylZFiCFtel2kq 7ybMK21seKdcY0KQ5NDx9/EXWF1FIgY8xhZoIISBepZRMKJNL0sJTvq57hZdRKiihhlJDa Pgrz6AC0YYLlpMa1jrUFL8/cZTpIKEEfW+pFYoX0e2//FJ4utR+LkRmW5tbrlitRS9KBBh 7CM4skeIMqJjURKSWaH55YYIESu4B/W8oHeeiECo1SzbYJiZPMko1UK34mCjXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jTWKl0jq8zrMX for ; Tue, 17 Nov 2026 17:04:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f553 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 17 Nov 2026 17:04:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Rick Macklem From: Mark Johnston Subject: git: 5a28955eeff3 - releng/14.4 - nfsd: Make nfsrv_getstate() validate the stateid type List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.4 X-Git-Reftype: branch X-Git-Commit: 5a28955eeff3d54eff84ea65fff07e515ebb42d2 Auto-Submitted: auto-generated Date: Tue, 17 Nov 2026 17:04:11 +0000 Message-Id: <6afc890b.1f553.5c9e64f6@gitrepo.freebsd.org> The branch releng/14.4 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5a28955eeff3d54eff84ea65fff07e515ebb42d2 commit 5a28955eeff3d54eff84ea65fff07e515ebb42d2 Author: Rick Macklem AuthorDate: 2026-11-12 17:19:03 +0000 Commit: Mark Johnston CommitDate: 2026-11-16 21:16:22 +0000 nfsd: Make nfsrv_getstate() validate the stateid type Otherwise nfsrv_delegupdate() can be tricked by a client into freeing a state when it shouldn't, resulting in a use-after-free. Approved by: so Security: FreeBSD-SA-26:79.nfs Security: CVE-2026-101317 Reported by: H. P. Cook --- sys/fs/nfsserver/nfs_nfsdstate.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index ece924630514..1f0f9cc38c2e 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -1749,7 +1749,7 @@ nfsrv_freenfslockfile(struct nfslockfile *lfp) * This function looks up an nfsstate structure via stateid. */ static int -nfsrv_getstate(struct nfsclient *clp, nfsv4stateid_t *stateidp, __unused u_int32_t flags, +nfsrv_getstate(struct nfsclient *clp, nfsv4stateid_t *stateidp, u_int32_t flags, struct nfsstate **stpp) { struct nfsstate *stp; @@ -1767,7 +1767,8 @@ nfsrv_getstate(struct nfsclient *clp, nfsv4stateid_t *stateidp, __unused u_int32 /* * If no state id in list, return NFSERR_BADSTATEID. */ - if (stp == LIST_END(hp)) { + if (stp == LIST_END(hp) || (flags == NFSLCK_DELEGRETURN && + (stp->ls_flags & (NFSLCK_DELEGREAD | NFSLCK_DELEGWRITE)) == 0)) { error = NFSERR_BADSTATEID; goto out; } @@ -1954,8 +1955,7 @@ tryagain: /* * Look up the stateid */ - error = nfsrv_getstate(clp, &new_stp->ls_stateid, - new_stp->ls_flags, &stp); + error = nfsrv_getstate(clp, &new_stp->ls_stateid, 0, &stp); /* * do some sanity checks for an unconfirmed open or a * stateid that refers to the wrong file, for an open stateid @@ -3476,8 +3476,7 @@ nfsrv_openupdate(vnode_t vp, struct nfsstate *new_stp, nfsquad_t clientid, error = nfsrv_getclient(clientid, CLOPS_RENEW, &clp, NULL, (nfsquad_t)((u_quad_t)0), 0, nd, p); if (!error) - error = nfsrv_getstate(clp, &new_stp->ls_stateid, - new_stp->ls_flags, &stp); + error = nfsrv_getstate(clp, &new_stp->ls_stateid, 0, &stp); /* * Sanity check the open.