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=1796380795; b=XJ+3Fk52AozoylVXAt4wLU1LvnsTrbNPY80gOpJ06Hu0Xk0t+c5NrOH2b7yRzH5Qly0S 6trbOG2uP+C8bh5qX3YJmSeoeBU6h5hPNxbvYEaZf1H5SrOJNz7RVteeJn44yvCi01989 5MOmv9paT1A1NrSE7xa8UyNkoUe0J8Xgec8GDUXG4xHNL7ma+xfyLYc13aUBkkGmheUGK lUJ0DVn1b1lX8qy/4TYqGjrIGIjmAg75oNuadm5hlRzIvPaYp/O7KO+PJx4oeA798632y f8/EAY3KVpBsKRwZxVDfoUrAkmH+QqjS4BXp6sld+YZjz2Jy2CxOIvdo24XPM2VmPag== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380795; 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=EHTDloIGHGzcuN612p2RsFdrHnftDojKHIphZQH26gY=; b=cPc7NUWPfN7fPD67iZdlX57UBvl+Pva1a5WJnX1XbX9UGFYl04oYBYWvDf48VAVUxn4F Kl/J3BXFfljdevQBp4fx5oNcsgbeYDlRQa7Eq1S+ABmkqevsafRzm1/HTWUnVwFtFKsTd 1tHEIDvTPVlpzcNd+z4n5iZ73sHwMgWuKtqW3GhQgb2N/WGycdhYfT3Sth8SYLR4hSMFY tSZ03h70mFuVQOTLpgJOv+yzzp4HcA1KhV1d/S+Ij03t0bpWg7oMuqBQyNJmHkZUVsbZ6 hJVjP/AKB2p2xiscZUZUEgI62xa4ZgJRC0G4XUXXccjnz+WTj6GMbfOFfJM8AP/fiUQ== 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="pH4w1p/o"; 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 EFAE4606A322; Fri, 4 Dec 2026 10:39:54 +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=pH4w1p/o Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CB811F000C2; Fri, 4 Dec 2026 10:39:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380794; bh=EHTDloIGHGzcuN612p2RsFdrHnftDojKHIphZQH26gY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=pH4w1p/o7eATquDtwQQAHuDo6a8QKdyJDyMld05Z7cztAdlulov4SXo8K31abilRH S7SCYqUeLX3Bw+0RiRFFrZKZpIThYiyOhJazRH6E0kzB8ZfkEl+aoiY2b25Jd6dvu5 Se7n5ho5NLZgVhYgtEjXHbMlmK1kaGqe/yPnc+kA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ye Weihua , Takashi Iwai Subject: [PATCH 7.3 426/742] ALSA: pcm: oss: Restore params flag after failed reconfiguration Date: Fri, 4 Dec 2026 19:04:50 +0900 Message-ID: <20261204100646.421898251@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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 @@ -1084,8 +1084,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);