From nobody Fri Nov 20 18:48:07 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 4jWPVH4SYdz72S7n for ; Fri, 20 Nov 2026 18:48:07 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jWPVH3vz2z3J76 for ; Fri, 20 Nov 2026 18:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795200487; 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=gcT4dq6r+6LI3c1Selh7ZGpqBHfbly23rYQm1yNoWnQ=; b=VJrXK/+9agI6zkS7Q6IMtOyE0rLQ/A2vZdCp6xMbpxLlDK87LhmDYJkGwyYP/YfnHiM+Og 8np4Wvca/rwo5phXgPGz/p2rO348aBXtzIuJq2JXRxVjU5JfxBsX31jl4tyQuUCfGVkv5g wS/29T6FnZpSFriFhSbWmKuVH/Zydy119x8QfgIqr2csONWK8GXguInWAq6IQ3j3l5mV0L RFbiNMIOKGiW41cM3N3v3j8Q74PFMm2YLs9banF5f0lepMiSpE31WQU+4WANB6AQqeWwj8 4eUooZkFHlpGP8A152C/75OmilUBBbIlS1fOY4gU7ver1ZKyO0tAGH67sEcwDw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795200487; b=JxjwMQuXbYqzWo8t+jwdY+Ssj8U8BjzCjKJO3PK41xWdrD752A5LT9uwQSqj+hrxG2xMPo gMXm77rUs/tOV6ZiPRpoQY2cTQrqFUQY0zOGHoDv7WUbxsOYKAO1s/IeYvP/fU0JpmZkXt 5BuktG0TurahOtjdnnmRUBMeb161Hv5ovqePnJz+kEfNUfrD8Z1W9ENlGORlZKx6iMbOlP HAPXSAhran+hFX/ne6EkrD/MwFJHbRINszlBZe+i8CYZEdgFpfILpDOEBoks8krSVbr05V 1/EgJmsz0abY2qYBjYLl2BuQE2WZbprvHa6xTW1SFtlTX6rUS9ojMF2XdItPPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795200487; 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=gcT4dq6r+6LI3c1Selh7ZGpqBHfbly23rYQm1yNoWnQ=; b=V0Rt8Z84CS+/98svhYNwuYNRl/aVh8L78o++AJwhGfxkEjFi7rnqOL++EOpDyRr6YLWcTZ 44DzmlWpsxvX4B416luVkSMRu9II2S+hmipuQjQ9AjmQu3+pNrCtT9S7iHuvDwklcu3h60 /1wjUULmKJKVhzY7Ou3aM44ABa/RJ71li2gOz055JssnmfNZxMkL/72zDPIviXOSocWZAX MpmcfUdpIBNDv3yE4MKqsbVUHJyOSidQ4XoWdgqvWUD7MRu9K7i6eg+9O9BiVUNEuanWMZ IQZY66ws2QdvdEToo0+7FwzQmVb/6j9blmXEFIzp061X1FFYOTLUK7xRdPZAdg== 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 4jWPVH3KFJz111J for ; Fri, 20 Nov 2026 18:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 50e0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 20 Nov 2026 18:48:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 01a8cd5ebe93 - main - sound: Unlock the channel when chn_reset() fails in dsp_chn_alloc() List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository 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: 01a8cd5ebe9368fd115fb5060bcb1e60d1bbdf1f Auto-Submitted: auto-generated Date: Fri, 20 Nov 2026 18:48:07 +0000 Message-Id: <6b0095e7.50e0.44871e1c@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=01a8cd5ebe9368fd115fb5060bcb1e60d1bbdf1f commit 01a8cd5ebe9368fd115fb5060bcb1e60d1bbdf1f Author: Christos Margiolis AuthorDate: 2026-11-20 18:47:25 +0000 Commit: Christos Margiolis CommitDate: 2026-11-20 18:47:25 +0000 sound: Unlock the channel when chn_reset() fails in dsp_chn_alloc() If chn_reset() fails, dsp_chn_alloc() returns with the channel lock held, dsp_open() calls dsp_close() as part of its cdevpriv error path, and this causes both a mutex recursion on the channel lock in dsp_close(), as well a lock order reversal. Fixes: 02d4eeabfd73 ("sound: Allocate vchans on-demand") Reported by: llm-postcr MFC after: Immediately Sponsored by: The FreeBSD Foundation Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D61793 --- sys/dev/sound/pcm/dsp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 77faac3b5589..5d1b4b2b22d4 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -238,8 +238,10 @@ dsp_chn_alloc(struct snddev_info *d, struct pcm_channel **ch, int direction, strlcpy((*ch)->comm, (comm != NULL) ? comm : CHN_COMM_UNKNOWN, sizeof((*ch)->comm)); - if ((err = chn_reset(*ch, (*ch)->format, (*ch)->speed)) != 0) + if ((err = chn_reset(*ch, (*ch)->format, (*ch)->speed)) != 0) { + CHN_UNLOCK(*ch); return (err); + } chn_vpc_reset(*ch, SND_VOL_C_PCM, 0); CHN_UNLOCK(*ch);