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=1796381427; b=AKAf//nO/GZw0056X3+CXeLuarDoRt3jAFx+Fv7ccNZMhbdEnXd9TfhMDxDRMYMWwkGr pgtmM7tVtGVKzwDCHgGiGRVA5UnqbImvSW/nkF5dHmzURVdF2g8cF8pCPcYmeYbij4Fhp jmApn0d/0wPOJXvyY8OTlsypFh1SmKupqSeJw68KhnRipfLAdfkNI/sl61jF+cLeEwqMp TlyHII6D0Wdj3bTv5e86UsBggigPTKKKiBrLK6ZRixFgxAceJHW/pRuIOAulho99pUajP 3LqhoUOG8MlTT1qZyThlR0uzl+P8c4zKt5zL4qiR0r3UZUgYbxj3hieYx48Fnmcy+fg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381427; 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=h++KZhHTmwyuO4q30/kTvXxJFqcYnanBOe0B0QQpr4o=; b=WiLFNVEYxsSH7XuWu1y12atUH1RAsqU5TUGFjqDqxJ3wvp/JQeAxUvZAo09rDcWwuADB e3j6lf0IcMQM/tKLx5CXsVdEavNVH2HN6mjwURBDISkVjaK+eMBbIM0vULjDF+Cv4IE52 JspGOnxjykbhghOre5xW/lnyWil2DgW04mTREc3tznfO0N4ntmFNIcUZyb4nJKcLhrI5S 2Vr/3iY7WELQetGo6On9h2VF1oBH8PJfGhRM5MfnW31bQwAzCbrP8eMee4y5YDW3jGFYw Lu55gXYgXJIA4J1Y5KLkf6xhbV9VTIyNYLnhw091qy3SZimdpbetHlAki6ceg2gwGMQ== 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=zyvuaawM; 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 48B04606A32C; Fri, 4 Dec 2026 10:50:27 +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=zyvuaawM Received: by smtp.kernel.org (Postfix) with ESMTPSA id 631861F000C2; Fri, 4 Dec 2026 10:50:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381427; bh=h++KZhHTmwyuO4q30/kTvXxJFqcYnanBOe0B0QQpr4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=zyvuaawMUQsN2dsWJk54G+WoVEUNIT+b5SaenscrSkl0rHBun8QOctvSvXETNdrT+ Zlxq+1hzJXLWBV/J8L34ZdVKkLZ4rj9ecWgyH51+rWNxAPUTDORIv7i/Rs2UTwAgDV Zl9S7Nh4gnzeQxdj97WdRluJ0TnIzQuluEEcSO5c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Miloslav Brada , Takashi Iwai Subject: [PATCH 7.3 697/742] ALSA: usb-audio: Dont queue playback URBs after stop Date: Fri, 4 Dec 2026 19:09:21 +0900 Message-ID: <20261204100653.566378467@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: 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 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Iwai commit 5a6fcabe156e91c6ef2435a74f2d16e6dd39f7c7 upstream. Although we've tried to address the corrupted ready_list for the playback URBs due to the concurrent start/stop of streams, there seems still a slight race: namely, in snd_complete_urb(), the driver checks the EP check via ep_state_running() and process push_back_to_ready_list() only when the EP isn't stopped. But since the EP state change can still happen between the EP state check and push_back_to_ready_list(), push_back_to_ready_list() may queue the URBs unexpectedly even after the EP gets stopped. This may result in a list corruption when the stream is restarted. The addition to the list itself is properly protected by a lock, so as a stop-gap, just add the EP state check again before actually adding to the list. In a long-term, we should reorganize the code to cover the EP state changes more consistently, but this should suffice for the particular race, at least. Reported-by: Miloslav Brada Closes: https://lore.kernel.org/awZs88beIhMcOchv@genesis.transkript.cz Cc: Link: https://patch.msgid.link/20261125141057.2094719-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/usb/endpoint.c | 3 +++ 1 file changed, 3 insertions(+) --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -449,6 +449,9 @@ static void push_back_to_ready_list(stru struct snd_urb_ctx *ctx) { guard(spinlock_irqsave)(&ep->lock); + /* don't re-queue after stop_urbs() flushed the list */ + if (!ep_state_running(ep)) + return; /* ctx may still be linked: a stale completion racing a stop/restart. */ if (list_empty(&ctx->ready_list)) list_add_tail(&ctx->ready_list, &ep->ready_playback_urbs);