From mboxrd@z Thu Jan 1 00:00:00 1970 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 AB3EF3E7BC2 for ; Fri, 15 May 2026 15:40:32 +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=1778859632; cv=none; b=c/RHobfZBE/aBWjTFkMc+yIbRFHau8/00hYA7hUu2w59QaU3H/rPAxKkszM/StVPDYljBSQGOAEc7sGc9OGZDSsyekpyJnunp4smxAK6gcZr051gRpGvj7dN8GEmZEUSpIqFOS4bAxufSenGX4Tl3gBLXBIwiXXWvJyBelHBQCw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778859632; c=relaxed/simple; bh=s2iyXy/lzp3S8OcTndlWySj8beQvPtSc5lWofJ65kJA=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=EW6pVnQ3MOkwQORO5Z0Z16VbKh5RrxhgbwLRbTAj+SRONqJSJ0cs8BRughG6N+mjMte0WinFukLGHf893zwPdEy++yyc0UsZw9DGOOPxW/7VU7LlGBgZXXVeru9e0t9M44rwJlMG/OKl6Tyu7wMc9Ekf3Kb3/v72ZCtYXwzEico= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wabp+9RM; 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="wabp+9RM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93E86C2BCB0; Fri, 15 May 2026 15:40:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778859631; bh=s2iyXy/lzp3S8OcTndlWySj8beQvPtSc5lWofJ65kJA=; h=Subject:To:Cc:From:Date:From; b=wabp+9RMBDJbpYDWtuoiD2Ttp5wiki7lkcW1rLoU4boGOC0eVnTpUlzjvp4ghXQqZ LTtC4u3fD+/K3inra6pQvKtUbVO4PWnBSrgk17p/ew/JQTKIKYJbHtB0VdPEgItfZd hSwz7iSnoQsnEN1pI3mxfRnqVq+W4Uyy6tzwkwUs= Subject: FAILED: patch "[PATCH] ALSA: core: Serialize deferred fasync state checks" failed to apply to 6.1-stable tree To: cassiogabrielcontato@gmail.com,tiwai@suse.de Cc: From: Date: Fri, 15 May 2026 17:40:36 +0200 Message-ID: <2026051536-resigned-occupier-194d@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-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.1.y git checkout FETCH_HEAD git cherry-pick -x 5337213381df578058e2e41da93cbd0e4639935f # git commit -s git send-email --to '' --in-reply-to '2026051536-resigned-occupier-194d@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 5337213381df578058e2e41da93cbd0e4639935f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A1ssio=20Gabriel?= Date: Wed, 6 May 2026 00:34:47 -0300 Subject: [PATCH] ALSA: core: Serialize deferred fasync state checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit snd_fasync_helper() updates fasync->on under snd_fasync_lock, and snd_fasync_work_fn() now also evaluates fasync->on under the same lock. snd_kill_fasync() still tests the flag before taking the lock, leaving an unsynchronized read against FASYNC enable/disable updates. Move the enabled-state check into the locked section. Also clear fasync->on under snd_fasync_lock in snd_fasync_free() before unlinking the pending entry. Together with the locked sender-side check, this publishes teardown before flushing the deferred work and prevents a racing sender from requeueing the entry after free has started. Fixes: ef34a0ae7a26 ("ALSA: core: Add async signal helpers") Fixes: 8146cd333d23 ("ALSA: core: Fix potential data race at fasync handling") Cc: stable@vger.kernel.org Signed-off-by: Cássio Gabriel Link: https://patch.msgid.link/20260506-alsa-core-fasync-on-lock-v1-1-ea48c77d6ca4@gmail.com Signed-off-by: Takashi Iwai diff --git a/sound/core/misc.c b/sound/core/misc.c index 5aca09edf971..833124c8e4fa 100644 --- a/sound/core/misc.c +++ b/sound/core/misc.c @@ -148,9 +148,11 @@ EXPORT_SYMBOL_GPL(snd_fasync_helper); void snd_kill_fasync(struct snd_fasync *fasync, int signal, int poll) { - if (!fasync || !fasync->on) + if (!fasync) return; guard(spinlock_irqsave)(&snd_fasync_lock); + if (!fasync->on) + return; fasync->signal = signal; fasync->poll = poll; list_move(&fasync->list, &snd_fasync_list); @@ -163,8 +165,10 @@ void snd_fasync_free(struct snd_fasync *fasync) if (!fasync) return; - scoped_guard(spinlock_irq, &snd_fasync_lock) + scoped_guard(spinlock_irq, &snd_fasync_lock) { + fasync->on = 0; list_del_init(&fasync->list); + } flush_work(&snd_fasync_work); kfree(fasync);