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=1796383758; b=yYMfTVmlY4Ac5lyGYpCjVQdAf6/9Tzwnb+0HJGrcigf93N1+NnLOSLHsOpSxChD1GnDB tSzKWj+/Qj3w4j7wMQu9Ljv4Qh5ebnsymBLZLcutwRJUvyWq+KpFJ27IX3YoeP9ikD/ea MceOBLjO5X0/+pR1/ISZ4UIHxv/c6ywNB4/yMB6p4lRAb//veFS3T6D6WpRa6ZRXs7+AA Lta+NJAPnz+td80nTCuPFSbv6B3OojZHLQqaxefGvOMNCtVEtFo0D5/pUmynFKP9RrAIS hgUK7rg2REFUvUrRUbPk0xfLXR+6qRcbAzKmbSLFerG66ZotPkFDcmWokJP/niE3TXw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383758; 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=17sIwpY439aV5b28AgWEpVaKhrzKWcGEJL5APot1Dxs=; b=cRPTjtbX7NsHsO03sEfgt/6hQIF9+WICIdoxe/lOqJTPJwuLS62MJJMgVMZJXlZQ1zWH OUwY6GtDvRj2q4a5rKVHWU08vVKDN9oL2fCMi1XIXo77IvhK2i5YsuuT596IAf1r2TopK L9WigcfzJ1+Djp6G4VCsq1xisWn1n5cJxQ4G0/J1SBMBUm0xoWHk/b5VWru9zf6nnpYtX 5mHpH6yxQZ+PWKak+a0i/LKx7/3oM38yP3+nFTPoeqZWHfw8MAVBTYcLp3wGKVLdcpa2Y O64vRwgvmlnH1PYKMD87ZI8A5rC8xLEFkBBjn0zNh+W8iqHBS9xL7/WezffGi6Ix0Kg== 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=Rc6Yy07r; 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 B7AA1606A333; Fri, 4 Dec 2026 11:29:18 +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=Rc6Yy07r Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD0741F00A0A; Fri, 4 Dec 2026 11:29:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383758; bh=17sIwpY439aV5b28AgWEpVaKhrzKWcGEJL5APot1Dxs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Rc6Yy07rwPTLpstpRuQRMnE5KklqAS7cYIwXUpXtVVKFwMjV/J/6OmREvZgJXnjAG PMJOJX2d0/xI1cdw6zIDb938NekpO3fLsz3XjoTnFsgXZdze65pPmvzBDnJNYpHCCe eAx//5kWsQhSGga/+5Bl61ycd8EQ3ASLLuU3BRuk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ye Weihua , Takashi Iwai Subject: [PATCH 6.12 355/555] ALSA: pcm: oss: Restore params flag after failed reconfiguration Date: Fri, 4 Dec 2026 19:06:38 +0900 Message-ID: <20261204100623.442851203@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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.12-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);