From nobody Wed Feb 16 23:00:45 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 8B3C319B8963; Wed, 16 Feb 2022 23:00:45 +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 4JzYMx3P66z3vV3; Wed, 16 Feb 2022 23:00:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645052445; 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=39jXXdKdeSKUnEeqMF7t3U81+1aDPFKkJJvybEWkD14=; b=Pu1fbqYJb1P5X90xZzlaj01DLyTIPGZE+4/31mFkbM2HwqsLg1iMmjQxEl1QOSr4BjMNcg YrTTHM6auqgFg6SHX0lHhJJzbveemTrtOlNMk+ZvyLYgSV/Z1lOx/AD4XOkUEUhv739UBc 9vApLRwp6Pnumj+xYMzDOMHuPe7PbxYjWQjTkD0+ksH5LO/Haj7n/X89OV1OqEUeHo3uUn BTmrOsyT+1vgau/bqx2eqfo5vwmX2lWo9H6lcqrd2rHnqlxdaF3s4g5p1Rbv3q4Sc2rP4M mnlrhYHHgg+QjCplMCdJdmQ6hjqZLwkLYY3T6yfB1voP02U7+0k71TOnGHCSiA== 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 55A561EC1A; Wed, 16 Feb 2022 23:00:45 +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 21GN0jWT062538; Wed, 16 Feb 2022 23:00:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21GN0jt1062537; Wed, 16 Feb 2022 23:00:45 GMT (envelope-from git) Date: Wed, 16 Feb 2022 23:00:45 GMT Message-Id: <202202162300.21GN0jt1062537@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: 95e95764918f - stable/12 - nfsd: Reply NFSERR_SEQMISORDERED for bogus seqid argument 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/12 X-Git-Reftype: branch X-Git-Commit: 95e95764918f97112bb05282d62d9777b706c2fb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645052445; 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=39jXXdKdeSKUnEeqMF7t3U81+1aDPFKkJJvybEWkD14=; b=BY81jMKc0yoPfONPHE58O46kZEUKZ44AjEOq4+RoKeSJT1syT+LwYrsiXycTkSdVIyE6mX INGu25By+HZLcS/GGHWOtNeAED8WEAeSBtZp/4HlDIqAD2Ne+c6q19RuNeJO4JwxwBhH2T R2N2Xna6Mw4T7JkR+zsz7P5tS/ar3/ezI4RI6dlwvQI46llMZ2dv/LbJwzPSY51bC3Vn0f EyXRnYc4yXfxacaSVvHItvS+c/rrwsxru2M3FNBxo00z9J/jyclpwnxqDzvWHE5CMjGAId ZgPFh4MK0Ogf+knVUWnq1t8vMozLv1zi22eYUQ+VsJE7PUVTvDvSQbVkqOxgFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645052445; a=rsa-sha256; cv=none; b=jncreCptrI4G7Mz9r1cbSeniCZY/y0y9hghaTtVIq4wjWxHyOojXZqXUoyttc5ravIdg2B uvfvSbuCo1JBoQQ0cThfKullS/nuAwyZVpnh0oX933xSrSGxPM4fszZMNKpS77X4DBExsm IuLHWDPmiRJzdnKRKIp7MFXPY04V17zHZve+NyVoJm3YMRDE8NYnWTOR6TF4p4l/PbzGAb TnxQtY6VC/uCSmB+sRp05zRr3H4dhB9KaHt9NrRSfrnZDEXXCwoxbGnyDf5VifSpwx8+/A nNumCAnlK5MNeNvYQFUzXebuF0u/E8XuLxAZOtjwbBFx/w08Hx6LcHk+567mfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=95e95764918f97112bb05282d62d9777b706c2fb commit 95e95764918f97112bb05282d62d9777b706c2fb Author: Rick Macklem AuthorDate: 2022-02-09 23:17:50 +0000 Commit: Rick Macklem CommitDate: 2022-02-16 22:59:41 +0000 nfsd: Reply NFSERR_SEQMISORDERED for bogus seqid argument The ESXi NFSv4.1 client bogusly sends the wrong value for the csa_sequence argument for a Create_session operation. RFC8881 requires this value to be the same as the sequence reply from the ExchangeID operation most recently done for the client ID. Without this patch, the server replies NFSERR_STALECLIENTID, which is the correct response for an NFSv4.0 SetClientIDConfirm but is not the correct error for NFSv4.1/4.2, which is specified as NFSERR_SEQMISORDERED in RFC8881. This patch fixes this. This change does not fix the issue reported in the PR, where the ESXi client loops, attempting ExchangeID/Create_session repeatedly. PR: 261291 (cherry picked from commit 17a56f3fabdfacb62f6d8858643cdb1861c8c1b5) --- sys/fs/nfsserver/nfs_nfsdstate.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 882ff97e62fb..d9fa64e5c416 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -676,10 +676,11 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, * Perform any operations specified by the opflags. */ if (opflags & CLOPS_CONFIRM) { - if (((nd->nd_flag & ND_NFSV41) != 0 && - clp->lc_confirm.lval[0] != confirm.lval[0]) || - ((nd->nd_flag & ND_NFSV41) == 0 && - clp->lc_confirm.qval != confirm.qval)) + if ((nd->nd_flag & ND_NFSV41) != 0 && + clp->lc_confirm.lval[0] != confirm.lval[0]) + error = NFSERR_SEQMISORDERED; + else if ((nd->nd_flag & ND_NFSV41) == 0 && + clp->lc_confirm.qval != confirm.qval) error = NFSERR_STALECLIENTID; else if (nfsrv_notsamecredname(nd, clp)) error = NFSERR_CLIDINUSE;