From nobody Fri Apr 3 17:06:02 2026 Received: from mail78-36.sinamail.sina.com.cn (mail78-36.sinamail.sina.com.cn [219.142.78.36]) (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 8D4A63806C5 for ; Tue, 17 Mar 2026 05:56:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=219.142.78.36 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773727021; cv=none; b=aCXn51phn9f9KF4ES9lDDMJni4WIhFGpdks73Pvdh+Ov7EQoeOOis2BX+/sKrjFolJ7cQS7L8/lcLN/c7GkYc4ipa8QrbT5Wy2yGeQaPm00molz8g4mzbhDLaJOEHz7267MPQ4wNFpCCpPkMusei+CGS5lVphuLniJpK0s2B8cg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773727021; c=relaxed/simple; bh=m5hRpstAhLzD7IdCLDe2omPzSiOPFVQcFychh771G/U=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=MCp9WV/T3hk+TCEJNx6GcJnBtMWx6ltAnjdFgu/62qfbdlsX6KToCif1ROpc+VjRNGms6vHS/l5H/NtIdnY9qIFF7O+5cNAwrZDHpQid27Z0asCMhJPEUfiCEDBteWANNWsbabn6ZMblZpNvKvjSY09bEe0a62PsY20U/srs8g0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b=WmVfIryS; arc=none smtp.client-ip=219.142.78.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b="WmVfIryS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sina.com; s=201208; t=1773727017; bh=iFmfJiTQvAlM2r3FEyEidXEE7a1oeH2iEnZ701ze8ew=; h=From:Subject:Date:Message-Id; b=WmVfIrySSZvqEj0XGxAEphpyRemrZx3hERK3r+0SSm0xktq12DNOEaeAFlx71mHnV puwL3LvFqqk4LlfQpsb/xzZjWrkILICHEdP2soseuKkc6xVgfVPGXjcAjArRGeuzJr j8h2IW7tnILy0D5poS2m0c6MRJbkFkEgk4Fij0ec= X-SMAIL-HELO: pek-lpg-core6.wrs.com Received: from unknown (HELO pek-lpg-core6.wrs.com)([60.247.85.88]) by sina.com (10.185.250.24) with ESMTP id 69B8ECFA00000461; Tue, 17 Mar 2026 13:56:12 +0800 (CST) X-Sender: johnny_haocn@sina.com X-Auth-ID: johnny_haocn@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=johnny_haocn@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=johnny_haocn@sina.com X-SMAIL-MID: 89518510748276 X-SMAIL-UIID: 0C247DF6E08C4D0392A3DB3210FF5354-20260317-135612-1 From: Johnny Hao To: gregkh@linuxfoundation.org, stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Takashi Iwai , syzbot+d8f72178ab6783a7daea@syzkaller.appspotmail.com, Johnny Hao Subject: [PATCH 5.15.y] ALSA: usb-audio: Kill timer properly at removal Date: Tue, 17 Mar 2026 13:56:04 +0800 Message-Id: <20260317055604.669076-1-johnny_haocn@sina.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- sound/usb/midi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/usb/midi.c b/sound/usb/midi.c index c6586da43a04..932ad94575e5 100644 --- a/sound/usb/midi.c +++ b/sound/usb/midi.c @@ -1530,6 +1530,7 @@ static void snd_usbmidi_free(struct snd_usb_midi *umi= di) snd_usbmidi_in_endpoint_delete(ep->in); } mutex_destroy(&umidi->mutex); + timer_shutdown_sync(&umidi->error_timer); kfree(umidi); } =20 @@ -1553,7 +1554,7 @@ void snd_usbmidi_disconnect(struct list_head *p) spin_unlock_irq(&umidi->disc_lock); up_write(&umidi->disc_rwsem); =20 - del_timer_sync(&umidi->error_timer); + timer_shutdown_sync(&umidi->error_timer); =20 for (i =3D 0; i < MIDI_MAX_ENDPOINTS; ++i) { struct snd_usb_midi_endpoint *ep =3D &umidi->endpoints[i]; --=20 2.34.1