From nobody Thu Feb 26 03:20:37 2026 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 4fLxYQ6CNLz6T6Cc for ; Thu, 26 Feb 2026 03:20:42 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fLxYQ4nG2z45Td for ; Thu, 26 Feb 2026 03:20:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772076042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FgXJvG791MAO2b3jzxQwtT5F6SoXocfSxJs7BnLQOHY=; b=M9iY+Vc1hv9GOA/+kGEfjNSiYBVpU0tGwhG0yTXyJbH8YbbbSac/wGOhco0thXvkvjZeuX 19kGhb9+jbrYGngmVtsKxsHFhNT0SOPiBNHYXk8uibUI/sPbY1+Xb2TlKEDBsz3iHePvyH 0zo/UZIjlXebal5Myl/hTySU1BL6elSMpMHvAL7XP22jWF2HiwQ/yGDXoIf0EPH4cIWZ3J lJMWZCHRunzbY6qkvPmmcP1zoFMQtkw8+ppz3oD0/K4iM49fHsPBsKOiH5zsgM0L8hG/o1 fudUhTGC4cEbaHEkhHRZvknciTM1/6Ek9NkMk9Gqfsh/BQBTUmESoWKLoRbGtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1772076042; a=rsa-sha256; cv=none; b=UDSmD2DpU7VyJXTU4cT/fNiBYqS9Cqs+h0usXJC2shhmD0wlG5TmIZPEfC3HEhNEn7wRmo xzl+Ik0N2WzriN+ESXi1zJL1AY2b7+/6anuzEsT3O5HDZETiIIKivRYdSJo12wi36R+MT1 0PXOEyp2HDRNV8mzDg+WaXHoKlR6Y0PPNNb0NC1E6o1sKF/NkYzTNXiNmXrFP2z/3ucCMI F/OjF1f/KsBQ7Y2twkj9sO/M5Zp5n48eejqdbcmHuvzQlYElv+YyQYcgw3cTSKk4fhE9uV Pbf9wKw5sVsOW7qz4qHk+Lx34i7A6SeuKdj7ik8fwxiCkoVrV1FEfB4j+FMqOQ== 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=1772076042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FgXJvG791MAO2b3jzxQwtT5F6SoXocfSxJs7BnLQOHY=; b=FlZvsB9HsKU3y99HlukuuftL8PJMr5LsFq35hdKzQ8LFKR8bXp9GyCfmJKIgqwF9wF8yRs rIZMHHtpXNUeFemvV3OjzE+Jqq0yRnXN035hRXQoCD1vuRzKcFXzWaashLvPuGF0YdUc3E uy4yfFCtChWEQbgHAbzDQBQCpe3IG3syoCOMJyeJb/k3ow/gqukTLlNpRIgjFcK3iWLwKE o+Eaod+pJ4DJZ58WqUC6UwBRjnP5VI7Gu6tVqyUuo3uUG0JQmvC4qAT5+YU1lOc5taTWkM fbV+lS0m77Or+5UI4/X72feuPiQ4Oy19a9IG7blucFg1DDS60A+RrL0NOMPEPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fLxYQ4MpGzF4 for ; Thu, 26 Feb 2026 03:20:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 27d40 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 26 Feb 2026 03:20:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Mark Johnston From: Colin Percival Subject: git: 49684d7d93d3 - releng/14.4 - nullfs: Fix handling of doomed vnodes in nullfs_unlink_lowervp() 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.4 X-Git-Reftype: branch X-Git-Commit: 49684d7d93d318391c4a2b33b74f5cc3fba61143 Auto-Submitted: auto-generated Date: Thu, 26 Feb 2026 03:20:37 +0000 Message-Id: <699fbc05.27d40.1fe8b41e@gitrepo.freebsd.org> The branch releng/14.4 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=49684d7d93d318391c4a2b33b74f5cc3fba61143 commit 49684d7d93d318391c4a2b33b74f5cc3fba61143 Author: Mark Johnston AuthorDate: 2026-02-25 15:31:30 +0000 Commit: Colin Percival CommitDate: 2026-02-26 03:12:43 +0000 nullfs: Fix handling of doomed vnodes in nullfs_unlink_lowervp() nullfs_unlink_lowervp() is called with the lower vnode locked, so the nullfs vnode is locked too. The following can occur: 1. the vunref() call decrements the usecount 2->1, 2. a different thread calls vrele() on the vnode, decrements the usecount 0->1, then blocks on the vnode lock, 3. the first thread tests vp->v_usecount == 0 and observes that it is true, 4. the first thread incorrectly unlocks the lower vnode. Fix this by testing VN_IS_DOOMED directly. Since nullfs_unlink_lowervp() holds the vnode lock, the value of the VIRF_DOOMED flag is stable. Thanks to leres@ for patiently helping to track this down. PR: 288345 MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D55446 (cherry picked from commit 8b64d46fab87af3ae062901312187f3a04ad2d67) (cherry picked from commit 6ed373227680b016b4cfa5af1b802ef23a121513) --- sys/fs/nullfs/null_vfsops.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index 8b9e04775449..cb637c98673e 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -465,16 +465,12 @@ nullfs_unlink_lowervp(struct mount *mp, struct vnode *lowervp) vhold(vp); vunref(vp); - if (vp->v_usecount == 0) { + if (VN_IS_DOOMED(vp)) { /* - * If vunref() dropped the last use reference on the - * nullfs vnode, it must be reclaimed, and its lock - * was split from the lower vnode lock. Need to do - * extra unlock before allowing the final vdrop() to - * free the vnode. + * If the vnode is doomed, its lock was split from the lower + * vnode lock. Therefore we need to do an extra unlock before + * allowing the final vdrop() to free the vnode. */ - KASSERT(VN_IS_DOOMED(vp), - ("not reclaimed nullfs vnode %p", vp)); VOP_UNLOCK(vp); } else { /* @@ -484,8 +480,6 @@ nullfs_unlink_lowervp(struct mount *mp, struct vnode *lowervp) * relevant for future reclamations. */ ASSERT_VOP_ELOCKED(vp, "unlink_lowervp"); - KASSERT(!VN_IS_DOOMED(vp), - ("reclaimed nullfs vnode %p", vp)); xp->null_flags &= ~NULLV_NOUNLOCK; } vdrop(vp);