From nobody Fri Jun 26 01:35:34 2026 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 4gmdXl07sYz6jjkV for ; Fri, 26 Jun 2026 01:35:35 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gmdXk68Nqz4525 for ; Fri, 26 Jun 2026 01:35:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782437734; 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=tKWyVMv1ATqZ9Dj4uO6XMPn7ZjtqUolz5i2B5IW1ssE=; b=u/geLSPtc2fzARzlSxkUjhs456nFFPVfi8JGoSixi2EOGh1mfxaz4DB4Cw73dWOXiNjptt 4X91sArRDNuA6VaNpVWDVOvOUz9GPOet2ZM+xL6bDlBLz3OXAHgrG0aGyJGABBmyfOsYDV VjsbRc7biq4dRreCYuH198olbXq7vrblaETvBLy1BKC0ZA7gnQ/4IQ0i2CZwbl7HYFgV/x 2rzX7QWRanrrcoNMQtZoZ+3RQGDlvudrkSpjGC8kPBYjWHNWL6hMbciPvoJi+DV6Q9JOo4 9Mit42MvhSlb81iD7b556bhJLynWD+i6Xm0V9H/wajIMU2JRhWHQexUjL5MoKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782437734; a=rsa-sha256; cv=none; b=d3qzzm8y03hqFAB4kWgG95C1sttpA9aVYeeLzjFFsnJfY2lSK56DSbOGtO9+pEhANlRK1X ++OyH354zRlpJHdwZ5FT8nZ+E0+rYJXvMmhrjCQ37xd4FNeYSA7odLEe0211lB838f2Rbv P2KnKibTGo90B8RVhxvImfBybaPzjvuugfAiJLIs0hkvjW+z89X3YI5NFu/sD59+A6rvup lmzI8o0LgGLv4r+IxChaQWBo0EGygbKSriylfgADWyCFjHZ1YhCCITJuHbl23O2zLxigR2 hduHGTi0YUfFs0cgyGea37vIj9blnFStbCkcWrbBRCVP6v6qj3/H2vntSKlA/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782437734; 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=tKWyVMv1ATqZ9Dj4uO6XMPn7ZjtqUolz5i2B5IW1ssE=; b=GPXwQRsUXe2hIZV9k/CvP4YIBksL1onZ6H9yEDoiJTRqqccxLEXQpJRy+YgJQFFVL27cq3 fd2HihXcx5T3V52ONzKHFVby0/P8E+dDC3QMPMzTol5qYiDPB6xOwwdo6Rt7iuxGqQ0gol 2CrwA0O+xnNGqThixbPBk0BVl3V/+EwC80dBnOxIXcVsXe6UfumAfKNy6UvPn/EOVg/RgT U3S5SoZpLXOCwLCsqy8Nue0001Mps3Qb6kxBdNGCgrmAbwF1/0Nmjc3VLqxHsW2iFtENFp uGZ5O2IlhST93u+16LQi5SMzDQGZEpeVcfOXhkuwnwEgYMmbtScU3a8JOynUpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gmdXk5B3Wz1Mr for ; Fri, 26 Jun 2026 01:35:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 42f42 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 26 Jun 2026 01:35:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 28ae0d849118 - stable/14 - nfs: Fix argument typo to avoid a crash 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: 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: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 28ae0d8491187bd7c4b244a68d79634dd8f9a698 Auto-Submitted: auto-generated Date: Fri, 26 Jun 2026 01:35:34 +0000 Message-Id: <6a3dd766.42f42.50673d46@gitrepo.freebsd.org> The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=28ae0d8491187bd7c4b244a68d79634dd8f9a698 commit 28ae0d8491187bd7c4b244a68d79634dd8f9a698 Author: Rick Macklem AuthorDate: 2026-05-25 19:22:32 +0000 Commit: Rick Macklem CommitDate: 2026-06-26 01:33:54 +0000 nfs: Fix argument typo to avoid a crash A typo resulted in the wrong argument for a bytewise comparison that could result in a crash if the incorrect argument was not a valid pointer. This patch fixes the argument. While investigating this, I noticed that the correct argument was not being filled in as required, so this patch fixes that, as well. Somehow, recovery from a NFSv4.1/4.2 server crash worked during testing, so this was not detected. The bug/patch only affects NFS client mounts using NFSv4.1/4.2. PR: 294925 (cherry picked from commit 4d80d4913e79c8b5918b1f04c1c7b38e6c76b9b4) --- sys/fs/nfs/nfs_commonkrpc.c | 5 +++-- sys/fs/nfs/nfs_commonsubs.c | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c index 0ae3b94bef89..c7ac2553d1f4 100644 --- a/sys/fs/nfs/nfs_commonkrpc.c +++ b/sys/fs/nfs/nfs_commonkrpc.c @@ -1247,8 +1247,9 @@ tryagain: goto out; } sep = NFSMNT_MDSSESSION(nmp); - if (bcmp(sep->nfsess_sessionid, nd->nd_sequence, - NFSX_V4SESSIONID) == 0) { + if (bcmp(sep->nfsess_sessionid, + nd->nd_sessionid, NFSX_V4SESSIONID) == 0 && + sep->nfsess_defunct == 0) { printf("Initiate recovery. If server " "has not rebooted, " "check NFS clients for unique " diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 6a9a73b40fb0..7c10e4bee964 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -337,6 +337,7 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp, * First, fill in some of the fields of nd. */ nd->nd_slotseq = NULL; + NFSBZERO(nd->nd_sessionid, NFSX_V4SESSIONID); if (vers == NFS_VER4) { nd->nd_flag = ND_NFSV4 | ND_NFSCL; if (minorvers == NFSV41_MINORVERSION) @@ -4919,6 +4920,7 @@ nfsv4_setsequence(struct nfsmount *nmp, struct nfsrv_descript *nd, NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID + 4 * NFSX_UNSIGNED); nd->nd_sequence = tl; bcopy(sessionid, tl, NFSX_V4SESSIONID); + bcopy(sessionid, nd->nd_sessionid, NFSX_V4SESSIONID); tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; nd->nd_slotseq = tl; if (error == 0) { @@ -5165,6 +5167,7 @@ nfsrpc_destroysession(struct nfsmount *nmp, struct nfsclsession *tsep, 0, NULL); NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID); bcopy(tsep->nfsess_sessionid, tl, NFSX_V4SESSIONID); + bcopy(tsep->nfsess_sessionid, nd->nd_sessionid, NFSX_V4SESSIONID); nd->nd_flag |= ND_USEGSSNAME; error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL);