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=1796386542; b=ws6rhhQl9bqhGsQtAQP8a48rbEDbMn+ADEUz7WxS7u/7hzbIHIZCHG+OXiB75KTRMAgE gogFvmmIHF9U/yU+CB/YMrTyqYYRFIxFm+Qc2M47NXRljR+O5X3waneF7rjAJDV67xbnX +4Xgrvclax3mF8U+nRJSBIYojqNh//2+wl3eC74wkveY26MH2QUn4U9341DldAhToe3K0 JyEL4HNqe7u0y7UB65Lr6Agn8KHAF4cuMgmtHxbrw7l8MayLBreASiw99puuRE69tXM/s bWA3lXs80AnVliORECI9Q2OnUJqSX0QqtCW/+8RWvIbqgSb4nJld/lXVP/SDF2N9nGg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386542; 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=l7vGzGUM6MeIpiYaFoX64uBOAXHvi8TQfZ7cJLS2efs=; b=v4lKpjhokpDy43aJHzqHzt36D/5Wj7c0KgJHeNHToNp0u7Rgo06HJTFj4NnA1JFiCjs+ UetnCso1UGL9Fv/17i4kZkouiIl8q9mOO+kYzjayN37HoGc/fgmKsUM/QeGm3/LeXlIFM vhOYohwUsaCfaVYArK6VuuMf/1vwwaq56AZf7y71qpphlluVTKbM2NeEA5MfzYOpaonU2 oItAWQlcjkCuaBeimWHMJpz542BYQnS2Ixy50ad/264LTDvBkGduYZ7Xzja0os1YGd489 4pHez2zxXGjeoB4MIVLP9w0TdTz/ETIWL0zdDPGFJqh0QXyApAu3uJ3Dl372k5/rpvQ== 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="Vz0Ax/Nk"; 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 C0CCF606A322; Fri, 4 Dec 2026 12:15:42 +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=Vz0Ax/Nk Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37DF41F000CE; Fri, 4 Dec 2026 12:15:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386542; bh=l7vGzGUM6MeIpiYaFoX64uBOAXHvi8TQfZ7cJLS2efs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Vz0Ax/Nkh+82nBFxRPyqM0C3gcf04vZk97oV+BawG1j2Q8bOPTLcqwXLIRtcO69Ka TGrprSRQvhWv4yqD7gjFzXp44gaUzcG2GxUU7uXAzIVR9A/4xiHfkp0T6jY808UtR4 ff9qqZCulSsQsrATYOt27sfFE8QzjUD9xVBULofQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ye Weihua , Takashi Iwai Subject: [PATCH 6.6 1007/1167] ALSA: pcm: oss: Restore params flag after failed reconfiguration Date: Fri, 4 Dec 2026 19:07:14 +0900 Message-ID: <20261204100728.438343285@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@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.6-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);