From nobody Tue Apr 7 01:05:25 2026 Received: from mail114-241.sinamail.sina.com.cn (mail114-241.sinamail.sina.com.cn [218.30.114.241]) (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 585B3199949 for ; Tue, 17 Mar 2026 02:51:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=218.30.114.241 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773715913; cv=none; b=qokFeYgBYtyZbvXtHtHsLjr9CVOnH+ySl0GDo9vet6RzsHVaz1JjobsEkGxIyC2M26KGMlnc6XlS2PyYMn+/JP3MpKwmajaDtqPlWebW+Rm03pZRfMx+TjSXfd4YHO7z2mEK0P2xvjsyv6GqXedjG/V2zgox6uRjFg6SeyxmxuE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773715913; c=relaxed/simple; bh=jLKL2lKhXfI2/DmOf+pTLkxhLQTj7HGC29A5yiCe/9s=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Y3YTnjUjwmxORjgfD7LzUaUg6aOyI9cYgH1USQvHJwTtqztA48ZyYdz4GmUgDqaEzEDVyDCIIF/+QvnSCZfQavzR/ORmoPTfujWtT/iHxh2pWE9GpvBaXFPqMR1myS2+IQQFpewtca67D+L9UK+F2yPW6/FzGEp2wmThNTyd/3E= 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=zOLlJdde; arc=none smtp.client-ip=218.30.114.241 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="zOLlJdde" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sina.com; s=201208; t=1773715908; bh=a3tVYHKGkp+Wt0rEwIghSMoFHSkOFOmADewWudRvcl0=; h=From:Subject:Date:Message-Id; b=zOLlJddeuV57emwLJjm2Zs+Q+o+qYO4hVppU9MfjifwD4jxGw5l51WKKhhW4+8ThI q181l7VaioLRBZOunJvTqbYD01qMFUEDz/Obo/pAqLOIPirvkdDaMkjBFRe028D8X8 rovgyTRJnzdxDK2oLNq9H4dnESR4Mz6ZsK7gVpTA= 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.23) with ESMTP id 69B8C1B600005749; Tue, 17 Mar 2026 10:51:36 +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: 9808178913048 X-SMAIL-UIID: A19FBD6092034B8C9D58D69725606AC0-20260317-105136-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 6.1.y] ALSA: usb-audio: Kill timer properly at removal Date: Tue, 17 Mar 2026 10:51:33 +0800 Message-Id: <20260317025133.554973-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 d300cd1f922b..08dd0f0b19a3 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