From nobody Mon May 16 19:21:55 2022 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 C25101B31EFB; Mon, 16 May 2022 19:21:55 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L28JM55R1z4rph; Mon, 16 May 2022 19:21:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652728915; 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=M2B1Ylf7JZ4/lqSpZRJanvN+0qEKXUJi4eNINN10Ccs=; b=xFMBIdzv/VlRXEFJ2J6pBFtsN22c+8dLpPr1wEQBJlczlNha69ffsMkDXm00guQ5rWHh5d LyJZcvkx9IgPg/O5AFehib+o3sng3UQAf4H9hIcAOSsdOZ74mtmxd2Jfee7ggyLuwbgJiv LnMLPc1ldreMww7qrrPuT+0AnwcMzgb1Kl02FDmRxalINUsgUER4IaDQq1O2fRHJUjfOrg GJHQmGldnU0f9phOhdRHX8UukhBGjmgl9O5/b681IQM19gBJ5YNcVfB/HuYaKnl2KuEAdV Zcu9QKytzRR8k1mZutNf/9xzBez3a8Z9xDifxnef+P1C4iLHX9XmfpWHGwyFig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9011125F19; Mon, 16 May 2022 19:21:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24GJLtMK030699; Mon, 16 May 2022 19:21:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24GJLtQn030698; Mon, 16 May 2022 19:21:55 GMT (envelope-from git) Date: Mon, 16 May 2022 19:21:55 GMT Message-Id: <202205161921.24GJLtQn030698@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: a3821a906e42 - stable/13 - nfsd: Fix session slot freeing for NFSv4.1/4.2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org 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/13 X-Git-Reftype: branch X-Git-Commit: a3821a906e42ad7b1886d1febbe63baa704d2029 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652728915; 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=M2B1Ylf7JZ4/lqSpZRJanvN+0qEKXUJi4eNINN10Ccs=; b=RjxfWLZgXRsXZtzL3LLV+hSDWuJ9gdwx0djJDdIPodDEy8v4k3GOdW7ZnbYX6ap6WaWusc a/onNtSDccxYQ3L6fjGfj0Yk3sq5BmxmDzme/u+YqalvXYWx+3DX7KCpms3+yFpW8p20HH pMrSXYdjj/XbJN8Koo4jGIwZ0M1nN7ncLqPWSNV3Iv5N34ZX3HYwRQi9J+9ExBvCjApo16 GKVhUlW3WABnC//SZNNu/o0nL1bh1t+7abP694BPiYrrlpbWJVLdFSD2WVOT5QeXV8jM+A FRc6Ei0XuqkEejbkr1hyNPmoeDz+uGoRAtGLJ1DF8F53HM/ANuOERfcFxxu4sw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652728915; a=rsa-sha256; cv=none; b=q1sJWENAJ1ZVMTuEjD40nJNzTqTsrDUZFyN+40zOFTP9RsjhtrrtKokqWSDEZ8wk//OWi6 V6L/nZnavWhv9pMgOruqEFBX6ZWBalm0EQDAdjj02sKwQ543PQzNp1/M9H9J9btrRxfcqb eo7FOydlwkdsNrYoGO/1Y1X47Tmg5HHQH0oPx0nW+P0StBF4a5/HZMPvqzU261Y4E362Fi sLlQs1TlkWZKja0bvMe3zuzv1rETMOIa8XMpv+jcwcD0/3imFUX5kVoaH28qcOoMGnBnrv yZQGP+Tn2AMRHLAQ2Y9QlWYzcxaawHMv2STIPgc/nnWh+jDRI0BaTCUz2WCP5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=a3821a906e42ad7b1886d1febbe63baa704d2029 commit a3821a906e42ad7b1886d1febbe63baa704d2029 Author: Rick Macklem AuthorDate: 2022-05-02 19:45:42 +0000 Commit: Rick Macklem CommitDate: 2022-05-16 19:21:06 +0000 nfsd: Fix session slot freeing for NFSv4.1/4.2 Without this patch the NFSv4.1/4.2 server erroneously always frees session slot zero for callbacks. This only affects 4.1/4.2 mounts if the server has delegations enabled or is a pNFS configuration. Even for those cases, the effect is mainly to only use slot 0 for callbacks, serializing all of them. There is a slight chance that callbacks will fail if the client performs them in a different order than received on the TCP connection. If this bug affects your server, you will see console messages like: newnfs_request: Bad session slot This patch fixes the problem. Found during a recent IETF NFSv4 testing event. PR: 263728 (cherry picked from commit 271f6d52a606e86c11b366082f11fe69350f24da) --- sys/fs/nfsserver/nfs_nfsdstate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 2abb99a5079e..9059b032cb86 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -6646,6 +6646,8 @@ nfsv4_setcbsequence(struct nfsrv_descript *nd, struct nfsclient *clp, bcopy(sessionid, tl, NFSX_V4SESSIONID); tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; nd->nd_slotseq = tl; + nd->nd_slotid = *slotposp; + nd->nd_flag |= ND_HASSLOTID; *tl++ = txdr_unsigned(slotseq); *tl++ = txdr_unsigned(*slotposp); *tl++ = txdr_unsigned(maxslot);