From nobody Sat Sep 13 07:13:30 2025 X-Original-To: dev-commits-src-main@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 4cP2Zf6WLhz67mXB; Sat, 13 Sep 2025 07:13:30 +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" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cP2Zf5D1Nz3s2V; Sat, 13 Sep 2025 07:13:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757747610; 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=KUsW5DGeURyMXp+iAUVx4QTL4w5qEsAYs8HcLTdMO80=; b=sHuVEoBhe9IiErtIkpGW1bEmwSDkuNVf7d9+Ud0AooE6WfOg0UmItIYceeWYC28ACwQH5H S3Vu5mRVfA96U7s1VdmfBKSjSIlvD8V+8ASjjzt9retqDKNlrcc7NmQKLulGKI7yfmuf/y MP0b/9574cqONscevfLduxwAhtJwrjACsFemzVlyo+t3n/cBy/8LMrp9YbpMtVgGIFtpkp mm0zFeVjwwmHeHpIXJnFB05q7wIhtDmDWr9c/WgjPCKMpPlUFiQsiYeHk87VFRY8/Gt4eZ 3YM3cPZ+ICUQLFTNDfZW4dBUAYuw55vvyCqC+SotoxxmvliyUbJUuo1yEFjGTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757747610; 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=KUsW5DGeURyMXp+iAUVx4QTL4w5qEsAYs8HcLTdMO80=; b=cbtCQJU6zSWY/a44RdfDEPcO+6A688gW3bkaq5w49MHSTAHpAumKhw1eMYz23PnglFSN20 Dulnkh4s7n0pPsKs1sstc8lStn4Pdv/FF96Ud9lkAHh3TAUvc4tVTpvzne0HzQLv9DMb2J x2LAJV6W++LQQ1OmoXn/1BVDyeDaQAnK4URPGU1PAH2SOk1SCussEqPdgCxZ6BHoxAwR4Z FHPbbCkTegHIEa0FSY9sCroDZ5T1EelphmexGGr5tD9gp1zR5+MDJRXgmV33c9nCn27c/m pnWdKscLaNNTQUVUZynUEga7rn4yYRwo3J2I0eVWKIj2yX40OjfZEDvqDzI4gQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757747610; a=rsa-sha256; cv=none; b=K2nECsKWXNFuxMilWUInbKCvybZ9BCSmR9bWS4q3YJBtB38jk6jRiZunUPHhpEAZBUxT8V BXZcEWiaABGf0lhggkHP0w1pUUbiy3XMezRPJ+B9rKuYuj4H1s9JwJqziXuEfFPoRDKp2E ITe2cWtgcwL0+A/gaVyKd2nYtCp/kVTjcRTSUY0wkGwIJIAj0Ue8nRoPuwwHkgsgA4L1xq OAKfDS4fD2j02h3SjyA7F6zmOH6b1lSJUMghXhHaYok8vS73bfIl37d+NEhtat2fDXrldg AEJ8g7qX+WipnFGzqb7856rrVmX5agPyPKqxyWgluLfzG3WroZVYFm+0CiFyIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cP2Zf4jsdzDL8; Sat, 13 Sep 2025 07:13:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58D7DUQX091538; Sat, 13 Sep 2025 07:13:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58D7DUAJ091535; Sat, 13 Sep 2025 07:13:30 GMT (envelope-from git) Date: Sat, 13 Sep 2025 07:13:30 GMT Message-Id: <202509130713.58D7DUAJ091535@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 63bd2416ccd9 - main - vfs: denote a bug when dooming vnodes with custom locking primitives List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 63bd2416ccd9c644b3dc557120bcccea6f7592af Auto-Submitted: auto-generated The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=63bd2416ccd9c644b3dc557120bcccea6f7592af commit 63bd2416ccd9c644b3dc557120bcccea6f7592af Author: Mateusz Guzik AuthorDate: 2025-09-13 07:11:30 +0000 Commit: Mateusz Guzik CommitDate: 2025-09-13 07:11:30 +0000 vfs: denote a bug when dooming vnodes with custom locking primitives See the added comment. The entire notion of how vnodes are doomed needs to be reworked, but the bare minimum would be to have filesystems provide ops for doomed nodes and keep ->v_data around at least until they are done with it. --- sys/kern/vfs_subr.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 57732ddab7d9..f86bda2aa6f0 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -4507,6 +4507,17 @@ vgonel(struct vnode *vp) /* * Done with purge, reset to the standard lock and invalidate * the vnode. + * + * FIXME: this is buggy for vnode ops with custom locking primitives. + * + * vget used to be gated with a special flag serializing it against vgone, + * which got lost in the process of SMP-ifying the VFS layer. + * + * Suppose a custom locking routine references ->v_data. + * + * Since now it is possible to start executing it as vgone is + * progressing, this very well may crash as ->v_data gets invalidated + * and memory used to back it is freed. */ vp->v_vnlock = &vp->v_lock; vp->v_op = &dead_vnodeops;