From nobody Wed Feb 09 23:19:01 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 ECA0819ACDE9; Wed, 9 Feb 2022 23:19:01 +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 4JvG6F6JLQz4TJB; Wed, 9 Feb 2022 23:19:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644448741; 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=HbBv3ugNv6H9v9xBx61IZXPg/PHpUACVpansAm8aXwA=; b=d1DHUqExqhWvS3qCcUtiXEWDX/ra9tjzTGM5tlcl8T3+q/2Km/HTOsBNJgCohE2HNS5D7S em7aUma4Yk0OiA3FcAxnsoPCG8vdlsJ3Wp13fPx3bqYAh1P4W6YXdmhOhXsyl2CG3vkFoW 6sid554/YF/y2jUsjDfNmUNNXSqiAgWWXdKI8MxSK8entFfGoi3z6rXmON2Bewv3c62RZn dMvIYBIbY4OAQF7xL3xev/yWLx+v1fKbGyCeg3ETr+u5By/QPkWmiX2UjacP4pj1ge9fX2 KXlSF45NGEvNzc1Yt1yXb3qw80lWv5GejzYKkpmZIqDRmIuHLq3TqMz8HFsqpw== 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 B7F2315FBD; Wed, 9 Feb 2022 23:19:01 +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 219NJ1p9090733; Wed, 9 Feb 2022 23:19:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 219NJ1wo090732; Wed, 9 Feb 2022 23:19:01 GMT (envelope-from git) Date: Wed, 9 Feb 2022 23:19:01 GMT Message-Id: <202202092319.219NJ1wo090732@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 17a56f3fabdf - main - 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/main X-Git-Reftype: branch X-Git-Commit: 17a56f3fabdfacb62f6d8858643cdb1861c8c1b5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644448741; 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=HbBv3ugNv6H9v9xBx61IZXPg/PHpUACVpansAm8aXwA=; b=f/Ts+0fI4a0/rR3g5TgNh3DixtAvgrCW+vY8WPnIos76OD7KrEPL3gjhLda8p4d2e9qPPm NviidlEQHrOMBPF7sFz0tcRiBZuhCbu5lY4kdJ7ydtER/mO9cP/9/np37R4uMZwK8jSwJp nAG++DlbTuYhcKGdccc9GO8AjORj7PiXDfSvj1JtXqrR7S0JZ+Hssm3JHYGWRmcohHo66B YqzdbLyfN+UAhUVb1HIAi83WE82RqVF5Zbo3yQYS7pllkTqc/2V0YgKG9CF42fFXTJx+z3 p751PHOuIZ/IWEJ9zyhIJQuzOx/PDDw9eniY/oVTVk4p9JofstaK1WpvNGslBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644448741; a=rsa-sha256; cv=none; b=U6EOkdsFZZpL43HhXNUubVQIfYvNyaRsgABC7lE1bfiuX+e/vLnwCKfhGzwin2QXTieeLu b4OZ9/tKbn3uWa8RXfHl4/pucxNweJeMGeXGqD/UPe9b7hhE5S8E85UaYg2h88q3fXqmFk 4fGIqQp1/bLokH8G2+4UJ81bLTsjRBFxsbkqwC2XQ2MscdDJzWiZ+7f5ZkJXM1Q/cN77L6 o6whq8Lu2Tv9QCA0hDq0j8QV1CsyfUv2ylh0L1DMtP1JspY19nEC4j5NZAtKvQ2nP+4CQT 5StnK1g3DYxZIyQozs0MCrPLZvIS/C5Bvk2LzmBEHe7CWApL+wdl+rM4vfJtdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=17a56f3fabdfacb62f6d8858643cdb1861c8c1b5 commit 17a56f3fabdfacb62f6d8858643cdb1861c8c1b5 Author: Rick Macklem AuthorDate: 2022-02-09 23:17:50 +0000 Commit: Rick Macklem CommitDate: 2022-02-09 23:17:50 +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. Reported by: asomers Tested by: asomers PR: 261291 MFC after: 1 week --- 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 e7256345f11f..7207be315db8 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;