From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382293; b=5KyZZ4mTc45uTdIRl4snpLavePa6eNFpuxzLxoOw7hYPfyGOdHQW2MG9TSVu/jdOU/ne 2rZCMV56xWipgB9FOERSOinI5Ioh4pL0kwhfEBnmRk3xHPs8TbO7YPDGq3NUnanZKIasb CRrVma8PqiSv1O8SueOKkFjruB8JrRcPYgSFRqeA9G2QFxvMOSRH6ghGTwe9iFqEiNVwK PkiMuplzE0G022aOOTEeUJiuSRfy1+/1UPyhiYE26wH7vCGVhzCiT4jlgPtP+gQvKCDo4 GEDAfrUMFnodX8h+a2Mvu2KujrFImgpzCBItDMpSunaA6aKSYfwnvLr75Fj1+8xwC5g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382293; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=D/ODeA13KqWdvZcaxWudlLtOgf7A3S84HSzTwHe7+V8=; b=iJDkANA8fwfz1K7d6vGrZuC3wyt47QvNkvQb37FYMVRhpdX8n6Ih6KnEF5ej1DfxIkSh Y3tLkKxV+hoRcMXJbyx64PBBlGKI8PbtmdKrhAmJpVdE2GJGrK7tyM3++xJtnKY6nVyt8 HtJaz3/fEOfKadhe53lRDiBD/E3JoH5BAma0JZGZC29dw1OLxr4GzMUXDiZW6XK0U20G5 nqZFnG+r1UFQLxKHOKefRewkqYeGom1IOvk2H0z+snojhetx8GcSasX4A+4IPT/B8hHeK p+DF1QYEwVXbeaYO1XtvsP0R+pPiIv3S2/l1ip6k+p7qt/aJGlD3mG1erh/+JVsqFjg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=KOxdOcfO; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EED4606A322; Fri, 4 Dec 2026 11:04:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=KOxdOcfO Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7932B1F000C2; Fri, 4 Dec 2026 11:04:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382292; bh=D/ODeA13KqWdvZcaxWudlLtOgf7A3S84HSzTwHe7+V8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KOxdOcfOUcihpY5yDEYpe/t//NcHNwGe8aqve5jD76YYnFslyxltUBNNC/eqSTN3i HNJmGMxyWiWRtxcQ7dkRkYhDfsg/GUvSG6uB8DGssykzPbUGRX+RqlTUGlgiu2+kUe M6jabPezpE5mw3tlBIiMoqUBjVrmJskkFvAuVW5I= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ye Weihua , Takashi Iwai Subject: [PATCH 6.18 390/703] ALSA: pcm: oss: Restore params flag after failed reconfiguration Date: Fri, 4 Dec 2026 19:04:49 +0900 Message-ID: <20261204100638.213338167@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ye Weihua commit bc3d6817c5325e76578cdd75e9c08bdadc5f73c4 upstream. snd_pcm_runtime_buffer_set_silence() may fail with -EBUSY when a concurrent PCM transfer is accessing the buffer. The error path releases runtime->oss.buffer and clears the plugins, but leaves runtime->oss.params cleared as well. A subsequent small read/write then skips the reconfiguration and dereferences the released buffer: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 pc : __arch_copy_from_user+0x78/0x23c lr : snd_pcm_oss_write+0x10c/0x340 [snd_pcm_oss] Restore runtime->oss.params on the error path so that the next OSS operation reconfigures and reallocates the buffer. Fixes: 47c27c9c9c72 ("ALSA: pcm: Improve the fix for race of buffer access at PCM OSS layer") Cc: stable@vger.kernel.org Signed-off-by: Ye Weihua Link: https://patch.msgid.link/20261116064850.3540576-1-yeweihua4@huawei.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/core/oss/pcm_oss.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -1082,8 +1082,10 @@ static int snd_pcm_oss_change_params_loc err = 0; failure: - if (err) + if (err) { + runtime->oss.params = 1; snd_pcm_oss_release_buffers(substream); + } kfree(sw_params); kfree(params); kfree(sparams);