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=1794047811; b=D7Jvr69TzPP5TGWVoTexldePu62qCqGWOcy8LoCMXbll0/SFtEDbx6rNxkMuM9BODHdr BjzbmeEgbKOFj869quesJTszfH+Ps0OldUCJskfJl5YVzWjEX7OpJUGupROdA/dmr2k+a uC+/LuTAJ6aYPJgHKGYIqH4YSphl6p5kZ2dbiwVaRghRUbm8FiEDRwTKyvm+qX9iBohqb YB60ivjpaQkI4SEk2grWnIJDLT+k1tBJpRY/M3ShZ0D3m9+yiB3iKPaycQLLZGGGJgDZo Vx2akzxOSFR2Bf4MrWbHpWvjHNgfACtqAUUrcGjcSXinoji/YcecH0aNQl/Dq4p505w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794047811; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=f8c5Y/3Lq+VUyWf2Vbu2yCfqY+tP+i4w9A0KNYAO7sw=; b=c3EGniZLS0qOht4YOKUJ9N95zfLZgVRJFFeI6+FzQyroLE7KGZoMjD06UXlBNuiTy00J QeDsuINxtzly7ppGsACi6ZL0/mLbDVvOkHe/GRoxdofmUuu27wT2NVmwI1RuY3pWoMGgm U1U0RDhL5w3AsVbhhqi5H4xEbVOpixv4rPcTiIcKOFc7OlG8QbRozG2ad51nG1syGfVqE gcyg0KIiWhyUpB5KeFDx3lIrienAIGi4a7ThG94ipJ7XnzZQfl2lJ7z7/1tG0XLSc25GL yQ7A6caKeJKqxc/iNwTnBjr5ErxdX1h8hM+aMMfUK6k4PvTnuWq9jAvqiCD4NidEbyQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=JdJcHp2a; 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 9933D606A331 for ; Sat, 7 Nov 2026 10:36:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=JdJcHp2a Received: by smtp.kernel.org (Postfix) with ESMTPSA id 172881F0089F; Sat, 7 Nov 2026 10:36:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794047810; bh=f8c5Y/3Lq+VUyWf2Vbu2yCfqY+tP+i4w9A0KNYAO7sw=; h=From:To:Cc:Subject:Date; b=JdJcHp2aBxnYq10b9qnBLSYDybN1ApoY3Xvu9CBEUIFxfn9EfRrcsXG/L9w+oioPh gY/v9LRoMn+XdZIH9HWz2pbz0P1zwr7h59DGD75XALk4TYc2+tHUi/siBizUPGG3BK YLOkgc5MXJugOX+OBXg57FvwTmorQ2y3uLTAvv2K7m0KiXbdWZX8lGjcG35ckAza8y gpP6nOz8v6tiaMq2KPNhc48gfhRXk1fwezBg4lMQrPP0ZW/kPlTqqwsdBQxrYSu7GF 87K6KPPAicIYt7DCkkpYoQ12TcAHzttY8Q6OBXt9VEp/54RFLXwn4MpF/LWkLmqabW 1m6rNfC9ly0Xg== From: Sasha Levin To: peter.ujfalusi@linux.intel.com, tiwai@suse.de Cc: stable@vger.kernel.org Subject: FAILED: patch "[PATCH] ALSA: compress: fix buffer leak on failed SET_PARAMS" failed to apply to 6.6-stable tree Date: Sat, 7 Nov 2026 05:36:49 -0500 Message-ID: <20261107053648-failed-6.6-fbc74ca9fbf7@kernel.org> X-Mailer: git-send-email 2.53.0 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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y git checkout FETCH_HEAD git cherry-pick -x fbc74ca9fbf7e0b8f6872ccac62f9f4a1f3b5e53 # git commit -s git send-email --to '' --in-reply-to '20261107053648-failed-6.6-fbc74ca9fbf7@kernel.org' --subject-prefix 'PATCH 6.6.y' 'HEAD^..' Thanks, Sasha ------------------ original commit in Linus's tree ------------------ From fbc74ca9fbf7e0b8f6872ccac62f9f4a1f3b5e53 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Mon, 19 Oct 2026 17:45:30 +0300 Subject: [PATCH] ALSA: compress: fix buffer leak on failed SET_PARAMS When the driver has neither ops->copy nor a preallocated dma_buffer_p, snd_compr_allocate_buffer() kmallocs runtime->buffer. If ops->set_params() then rejects the parameters, SET_PARAMS fails, the stream stays in the OPEN state and keeps the buffer. The next SET_PARAMS allocates a new buffer and overwrites the pointer, so repeated SET_PARAMS calls with parameters that the driver rejects leak one buffer per call. Release the framework-owned buffer when ops->set_params() fails on an OPEN stream, so that a failed SET_PARAMS leaves no buffer behind and the buffer is allocated only once per successful setup. Use the same ownership check as snd_compr_free(). Fixes: b21c60a4edd2 ("ALSA: core: add support for compress_offload") Cc: stable@vger.kernel.org Signed-off-by: Peter Ujfalusi Link: https://patch.msgid.link/20261019144533.30665-2-peter.ujfalusi@linux.intel.com Signed-off-by: Takashi Iwai --- sound/core/compress_offload.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 5c0db178d635f..50301f72579ee 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -702,8 +702,15 @@ snd_compr_set_params(struct snd_compr_stream *stream, unsigned long arg) return -ENOMEM; retval = stream->ops->set_params(stream, params); - if (retval) + if (retval) { + /* the stream stays OPEN: drop the buffer of the rejected setup */ + if (stream->runtime->state == SNDRV_PCM_STATE_OPEN && + !stream->runtime->dma_buffer_p) { + kfree(stream->runtime->buffer); + stream->runtime->buffer = NULL; + } return retval; + } if (stream->next_track) return retval; -- 2.53.0