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 BD749385D85; Tue, 12 May 2026 17:43:53 +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=1778607833; cv=none; b=RajoTkCHMNTAHrweyHbaj491UDGgGe1x08gAO9GrU2dkEnUrr9ko8EJ+H9Y6Ioe4nYgt9IRFXp73HEYe+xEz5qKxVzdF6lxf5Oqy1RVnMYARbTTuV4sEBM1uQ2e3lsAap8Wf4Mg3nGjnjVNtYKTmjacbs5VoUEksvW4a/JZrDCM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778607833; c=relaxed/simple; bh=Kaa277mV3N4otI4uwpkkY+RusGLGmaAofPumTEUM6/c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=T1IYeRLwwRKm6hdKtDZ2jxnsd8zviYBqOF+DDwKJxmTIojIu9qkoxVoPZoVB/Jdhi1u3kjm04yYgaLn1R3JkQplHaAlsx8f5dHBMKjnxuTT9K3j5gfenoSAJjfMKdJv9/1KehasSOtbMsdtMkfnhp+Sf/1BsoRfoIFAgLPh3CFE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=m2Ysd2O/; 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="m2Ysd2O/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55E62C2BCB0; Tue, 12 May 2026 17:43:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778607833; bh=Kaa277mV3N4otI4uwpkkY+RusGLGmaAofPumTEUM6/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m2Ysd2O/CQuYBVlPJEK2fnQHHMcYf8VDtMt9uzZc3RHeXsKI7u5IbDDSgkcxa4jbL woderXQ1XKuAFyKxP5zDWDpewb1F05dDhrxhCQ7USGpNujpt5BIgAMd+HOfpZeh46x Nzjc9Xm06shZXADadUmi1p/OCg12brNFHZZR2ZV8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Takashi Sakamoto , =?UTF-8?q?C=C3=A1ssio=20Gabriel?= , Takashi Iwai Subject: [PATCH 6.12 051/206] ALSA: firewire-tascam: Do not drop unread control events Date: Tue, 12 May 2026 19:38:23 +0200 Message-ID: <20260512173933.918492234@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260512173932.810559588@linuxfoundation.org> References: <20260512173932.810559588@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore 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 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Cássio Gabriel commit 0749daa8eb5ab90334aaad3b0671efd7150d43b1 upstream. tscm_hwdep_read_queue() copies as many queued control events as fit in the userspace buffer. When the buffer is smaller than the current contiguous queue segment, length is rounded down to the number of bytes that can be copied. However, after copying that shortened length, the code advances pull_pos to the original tail_pos, marking the whole contiguous segment as consumed. Any events between the copied portion and tail_pos are lost. Limit tail_pos to the position after the entries actually copied before updating pull_pos. When the whole segment fits, this is equivalent to the old tail_pos update; when the buffer is smaller, the remaining events stay queued for the next read. Fixes: a8c0d13267a4 ("ALSA: firewire-tascam: notify events of change of state for userspace applications") Cc: stable@vger.kernel.org Suggested-by: Takashi Sakamoto Signed-off-by: Cássio Gabriel Reviewed-by: Takashi Sakamoto Co-developed-by: Takashi Sakamoto Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20260503-alsa-firewire-tascam-read-queue-v2-1-126c6efd7642@gmail.com Signed-off-by: Greg Kroah-Hartman --- sound/firewire/tascam/tascam-hwdep.c | 1 + 1 file changed, 1 insertion(+) --- a/sound/firewire/tascam/tascam-hwdep.c +++ b/sound/firewire/tascam/tascam-hwdep.c @@ -73,6 +73,7 @@ static long tscm_hwdep_read_queue(struct length = rounddown(remained, sizeof(*entries)); if (length == 0) break; + tail_pos = head_pos + length / sizeof(*entries); spin_unlock_irq(&tscm->lock); if (copy_to_user(pos, &entries[head_pos], length))