Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF58B3BA25B; Mon, 23 Mar 2026 16:23:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774283017; cv=none; b=rxtyRN6AdUg8fEKkIPqypRmcf6oHEum2e9d5lFvL3mENu27fxjJmzWWBT1n9e7iSGdi/a767sqvjReauhiLK5fkwWTDadAl9V5Dc2Vp1HNDLAoABawQTttr6aNyCBrqwS7enHynBvg2uN2iIHDf5oE7IlkenXCldQGZyU/v7JPE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774283017; c=relaxed/simple; bh=3Wxt6kfKzww9bmaR0kdr4Iu5ZYsG7cKK2MN/hxNVgoA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cLyhaGRL9hNRv2/7qepGn6xrTNXcHZzBpmVViTZeDeHQndxJl/T0b3MQimwkYcwEGfbJ2/Qg6+PQqzTJdjnxt+Sfo8DpAuaGyMduYihj8ZHtve4y4LJt4FK6On2cMe3U5thNjlZ1tnrUIpLe77QdC126oDQgtlGr1dn8Zb5IX0w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NWLAze9G; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NWLAze9G" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48086C4CEF7; Mon, 23 Mar 2026 16:23:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774283017; bh=3Wxt6kfKzww9bmaR0kdr4Iu5ZYsG7cKK2MN/hxNVgoA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NWLAze9GjRM1YjSNDveOjqqpqYDLzoZmGN/rf23ydpQmD5+0vENwd1im/ZhYXN9n2 7L+7AMfFFX5yyZHgvMAAMMlYCOdMo29cZqy53h8jmjI9aesQm2V0jGd5FnStTf1UlP /ZJZX4mP6/0+/CQxFaWdtUQ3UeIQBBGj0kd7AQt8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+d8f72178ab6783a7daea@syzkaller.appspotmail.com, Takashi Iwai , Johnny Hao Subject: [PATCH 6.1 369/481] ALSA: usb-audio: Kill timer properly at removal Date: Mon, 23 Mar 2026 14:45:51 +0100 Message-ID: <20260323134534.120863417@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134525.256603107@linuxfoundation.org> References: <20260323134525.256603107@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Iwai [ Upstream commit 0718a78f6a9f04b88d0dc9616cc216b31c5f3cf1 ] The USB-audio MIDI code initializes the timer, but in a rare case, the driver might be freed without the disconnect call. This leaves the timer in an active state while the assigned object is released via snd_usbmidi_free(), which ends up with a kernel warning when the debug configuration is enabled, as spotted by fuzzer. For avoiding the problem, put timer_shutdown_sync() at snd_usbmidi_free(), so that the timer can be killed properly. While we're at it, replace the existing timer_delete_sync() at the disconnect callback with timer_shutdown_sync(), too. Reported-by: syzbot+d8f72178ab6783a7daea@syzkaller.appspotmail.com Closes: https://lore.kernel.org/681c70d7.050a0220.a19a9.00c6.GAE@google.com Cc: Link: https://patch.msgid.link/20250519212031.14436-1-tiwai@suse.de Signed-off-by: Takashi Iwai [ The context change is due to the commit 8fa7292fee5c ("treewide: Switch/rename to timer_delete[_sync]()") in v6.15 which is irrelevant to the logic of this patch. ] Signed-off-by: Johnny Hao Signed-off-by: Greg Kroah-Hartman --- sound/usb/midi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/sound/usb/midi.c +++ b/sound/usb/midi.c @@ -1530,6 +1530,7 @@ static void snd_usbmidi_free(struct snd_ snd_usbmidi_in_endpoint_delete(ep->in); } mutex_destroy(&umidi->mutex); + timer_shutdown_sync(&umidi->error_timer); kfree(umidi); } @@ -1553,7 +1554,7 @@ void snd_usbmidi_disconnect(struct list_ spin_unlock_irq(&umidi->disc_lock); up_write(&umidi->disc_rwsem); - del_timer_sync(&umidi->error_timer); + timer_shutdown_sync(&umidi->error_timer); for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { struct snd_usb_midi_endpoint *ep = &umidi->endpoints[i];