From nobody Wed Sep 30 09:51:31 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 4hvr0g4Zqsz6v8bk for ; Wed, 30 Sep 2026 09:51:31 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hvr0g2h7yz3NMW for ; Wed, 30 Sep 2026 09:51:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790761891; 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=CTih7np3Oy3YQ1e6/LUmSGFE7wb8Icvp34hXUKiKtqA=; b=eqinXhrfHYFzJH1MrKQRYpZNfbnb1Cm6N5hJ1fGSXECAPbSQEwCjPSK6W0/+4dbpv2SZ5S QPqv/pJi3P02ML6GwVCb6GANbO8sekzeTTDVStYY6kOzbapj+wyMRFmF2y8q2iARvktw4M H6RnrIZu7tgXpoQc4y31OZ4eGELuMmTHbyG0iJqcQDsbaQs58ZDQz37VqYWXZixvuCO782 sSpN2GHELDoYUZzRLGspBtZlE6dFTzQD7+7HLv8cmY4G9HAhiVKmFycY2w02h391ISB00J P2Wrz5QpRWGxzgmVm6TbSzX3P2mc2C/mvBiBPx+eJx5fxHBpwtbyddX6FUZw9A== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790761891; b=aPjJNkgM2PPelZUPLtsq2R0gyjnahJI96LS+JW3uV0UJz2mqCMcfNx6F/oQDp7n1LnrSup qooQBBsaLXPUWey9GhnS5xb4+iYku6q98p60m2oE8JYH3wDEONU+5sbefQucIJ8NkmIHfe /2YVYCUaLP0AdqNLFRMfRh+bqwnZI4cx4QdvZqGrb61rukL3oAb3eqyHFQoluVYiE3Z+kZ l1/m1vGhKLVAUBJoVIY6zVTlNZEoNM0GBOqQ8JIiJeZ0tx6ZrqKzo6Nw6xKCQ3LdCULjyV SXTG71JOQ/sZ+HGe/rT6y69+wBXnQ6IIzBlNIhnF9eJ/duyfjn8yemKUUK1Hwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790761891; 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=CTih7np3Oy3YQ1e6/LUmSGFE7wb8Icvp34hXUKiKtqA=; b=H8Ki7Us9zavRkfkQKS8oDaF5enNbDDuJDO3+rPKQtFKZLIoZN5dD9P49QCbTaf+gpzgl5N YA+zIJWhaMdAin5+QoOK+8InjiTbuBeIC8gLJsMMi7zXUC2+koN0liECHRrnWv6HLM/bgb XgqxFHpLvOtFUE3RUSuNsaS5n4gg++CQvKhkS5esUJFzBnEG6xzEaVUimtSP8ggIska181 cKbcGTvGPSNP9dEf18izMUM+zgQvRkoz8bG2kRrvAIJDdSz3dzYHuJXs/ofVZiEB0qIKqY ZmN0+GffPosDQQlni5rxvZMNl6+8qMrlLJPj7XHGc+ALFmCptUudaHy6MGnD2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hvr0g1TtYzgdd for ; Wed, 30 Sep 2026 09:51:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3442d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 30 Sep 2026 09:51:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: f96c4f45f791 - main - cuse: Assert the server refcount 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 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: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f96c4f45f791124192363c9aa2898b1d0e4cc6d0 Auto-Submitted: auto-generated Date: Wed, 30 Sep 2026 09:51:31 +0000 Message-Id: <6abcdba3.3442d.359ec085@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f96c4f45f791124192363c9aa2898b1d0e4cc6d0 commit f96c4f45f791124192363c9aa2898b1d0e4cc6d0 Author: Christos Margiolis AuthorDate: 2026-09-30 09:51:05 +0000 Commit: Christos Margiolis CommitDate: 2026-09-30 09:51:05 +0000 cuse: Assert the server refcount Assert that the refcount does not underflow before decrementing it, and that it really is zero by the time the server is freed. MFC after: 1 week Sponsored by: The FreeBSD Foundation Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D60043 --- sys/fs/cuse/cuse.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/fs/cuse/cuse.c b/sys/fs/cuse/cuse.c index 081fe1fe0bad..7408478f4ba7 100644 --- a/sys/fs/cuse/cuse.c +++ b/sys/fs/cuse/cuse.c @@ -648,6 +648,7 @@ cuse_server_unref(struct cuse_server *pcs) */ cuse_global_lock(); cuse_server_lock(pcs); + MPASS(pcs->refs > 0); if (--(pcs->refs) != 0) { cuse_server_unlock(pcs); cuse_global_unlock(); @@ -683,6 +684,7 @@ cuse_server_unref(struct cuse_server *pcs) mtx_destroy(&pcs->mtx); + MPASS(pcs->refs == 0); free(pcs, M_CUSE); }