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=1796389233; b=VxRyw1qmFERzLzLEpq4yyA0r8Op3ErrFIX9YcYmtz/v7dMWmg9Jxu3NfvJXmAlC/jCWI PORR8AUzPh/LN8ZbfQLVSxAXkAwGimYoVZR2McgrDmCKnyyPiekIzs7YmsMwIOmzEm+zL vPQvMDS6MRG4MSGLjSNXaxLT8SgE62K+NPttINNDJHnOIw7EOgXn5KM4gdyGJ8tjAmob9 6QQPNslThSxLOvMn4wyRDbd8THvlep/LeL8u9RL2KtjYgssxybhwdEVwjVJB/Hj4khHrd o/5OpnRuD6jcIslaxKj2WQPGmsgOp9v/31bFA68VM+gTPJhOSS7WGyfL6RS55VEV02w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389233; 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=57A9XyJaZWdQOQW1gFgDlZ5d8MvnyUDPhy9BLMu13P0=; b=0JvYujA3UomnfYkv8v8YdbZRCw0N5gdV555YuFjMPufreIIRuGUOlyhfX2Ct0P4o5CKK qwYqtop17N3Qq1IYkgUjfVEY/kb7Ti6rM4LzJwm751Poar55ea5958nEfW54R9y+2F+Ht uR5hrRBN2wSDT1GBScBPf1pF4r9IGZtOBcLMRPy2TrhegbA2sYE0ZxPE8daUothVc1VQF wwIa+ObsM/wR7fnOSi/kwfRr57vG1xvi5wAkVpikc9nbZM/HpJ4z4dPl4kdTAJsk4wcxC VsEhFzh3TPJ9bvpILfSGy8aA4ImOGh++rvl8Slq1iHeFTI633nkdzst22/yycxtptQA== 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="TeYy/jdx"; 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 E757D606A322; Fri, 4 Dec 2026 13:00:32 +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=TeYy/jdx Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B29D1F000CE; Fri, 4 Dec 2026 13:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389232; bh=57A9XyJaZWdQOQW1gFgDlZ5d8MvnyUDPhy9BLMu13P0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TeYy/jdxWrM22H5eQUOfbJuuxBOH5d3iFn40gC13NQXv19mDQW7x/IXT371KZaZ// 2kyPFlHuypAfza+EoCKlP+GwaRMfmGUYpANvhXg/iy4yFk0vRIPGiIpRWjLP8Gr/SE Ljj9q2R0Sm0bdlfsP3+F0WwipWc6jSNxCRI0KJ9k= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ye Weihua , Takashi Iwai Subject: [PATCH 6.1 0914/1059] ALSA: pcm: oss: Restore params flag after failed reconfiguration Date: Fri, 4 Dec 2026 19:07:25 +0900 Message-ID: <20261204100707.696897409@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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 @@ -1093,8 +1093,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);