From nobody Sat Dec 11 02:31:50 2021 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 8851D18E3F7F; Sat, 11 Dec 2021 02:31:50 +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 4J9sGt22Gpz4Vn5; Sat, 11 Dec 2021 02:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 26C47253FD; Sat, 11 Dec 2021 02:31:50 +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 1BB2VoWl091361; Sat, 11 Dec 2021 02:31:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BB2Vou2091360; Sat, 11 Dec 2021 02:31:50 GMT (envelope-from git) Date: Sat, 11 Dec 2021 02:31:50 GMT Message-Id: <202112110231.1BB2Vou2091360@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: 3e8081ac8869 - stable/13 - nfscl: Sanity check the Sequence slotid in reply 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: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 3e8081ac8869e2b5b92d4a84c217a05cdd10487a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639189910; 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=RMXvq0G2b3cJG4Ib/IET4c6k1XXCCLdUwqK1GL0kQxU=; b=lhpYkuQ73gARyhCQi7BuK2dH7uFpdoKL7jHlpUcINIz2sufyAf8ZRrKlzFoTQvsMIJWnhm 8xU2Ed1u+uGGAVGvkcpBdThgpegr4eDQuBlSEoNScjri7/dbWu4S1lDGcRERV2S95SmW45 x9uuk4b+bBQjJwSa3b17rtYdjMgb3B0myS7StsozDnRVtV7O1l6XXkzh0nZhrDwKZguObX VOvm2eXFRglu3k3LkGrg9M0zhT7EhS25UGhgzO8SmCkiKHmtWGq2liLNNIkLTmNvbDma9i 0QNPJB4BVOEBqjN7tCSxlSBVZstFYZ2zHDOzDrRiDcYt9DTl9M3HPnKfFNg0BA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639189910; a=rsa-sha256; cv=none; b=Qf4LKXLRoCjGyXjXEtaIOH1WdUME+8gXqLmD7PzHu9M5A1OuaHid6XWYEOeMMBh6VqWrix Fv0vzVOh/32ObV/MwvgPILapsTVTz0GOEtbdfNGK+vMwlIRv1yTvMbnIe/xTvGw+eLVHWT kAIUAzeqqHxorcBhrUUXdYIHzbEPJl/pH9oTvHqTgRZzCWpy2m407QX4V2nQ2fQyb840nK MKu2PiyKITvB74SWFZ1zuSYG6k4mnjMDFbO/X4Wjf2TwZ3f4Y1dyJ4lVW6NaeiJyaorwfv QO0x1S9Ecvw2z0QmLlFecq62iDOuDeaU7kwMzkSHBixr4b+1W3Ic/Ksm4NKTHw== 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=3e8081ac8869e2b5b92d4a84c217a05cdd10487a commit 3e8081ac8869e2b5b92d4a84c217a05cdd10487a Author: Rick Macklem AuthorDate: 2021-11-27 23:02:04 +0000 Commit: Rick Macklem CommitDate: 2021-12-11 02:28:14 +0000 nfscl: Sanity check the Sequence slotid in reply The slotid in the Sequence reply must be the same as in the request. Check that it is the same and log a console message if it is not, plus set it to the correct value. PR: 260071 (cherry picked from commit 1c15c8c0e935f3f7def7b03e9546f7d6790f465e) --- sys/fs/nfs/nfs_commonkrpc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index c1a5fab2a358..4d8db64f419f 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -1038,6 +1038,18 @@ tryagain: tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; retseq = fxdr_unsigned(uint32_t, *tl++); slot = fxdr_unsigned(int, *tl++); + if ((nd->nd_flag & ND_HASSLOTID) != 0) { + if (slot != nd->nd_slotid) { + printf("newnfs_request:" + " Wrong session " + "slot=%d\n", slot); + slot = nd->nd_slotid; + } + } else if (slot != 0) { + printf("newnfs_request: Bad " + "session slot=%d\n", slot); + slot = 0; + } freeslot = slot; if (retseq != sep->nfsess_slotseq[slot]) printf("retseq diff 0x%x\n",