alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH] ALSA: firewire-tascam: fix corruption due to spin lock without restoration in SoftIRQ context
@ 2020-01-13  8:57 Takashi Sakamoto
  2020-01-13  9:41 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Takashi Sakamoto @ 2020-01-13  8:57 UTC (permalink / raw)
  To: tiwai; +Cc: alsa-devel, Scott Bahling, stable

ALSA firewire-tascam driver can bring corruption due to spin lock without
restoration of IRQ flag in SoftIRQ context. This commit fixes the bug.

Cc: Scott Bahling <sbahling@suse.com>
Cc: <stable@vger.kernel.org> # v4.21
Fixes: d7167422433c ("ALSA: firewire-tascam: queue events for change of control surface")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/firewire/tascam/amdtp-tascam.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/firewire/tascam/amdtp-tascam.c b/sound/firewire/tascam/amdtp-tascam.c
index e80bb84c43f6..f823a2ab3544 100644
--- a/sound/firewire/tascam/amdtp-tascam.c
+++ b/sound/firewire/tascam/amdtp-tascam.c
@@ -157,14 +157,15 @@ static void read_status_messages(struct amdtp_stream *s,
 			if ((before ^ after) & mask) {
 				struct snd_firewire_tascam_change *entry =
 						&tscm->queue[tscm->push_pos];
+				unsigned long flag;
 
-				spin_lock_irq(&tscm->lock);
+				spin_lock_irqsave(&tscm->lock, flag);
 				entry->index = index;
 				entry->before = before;
 				entry->after = after;
 				if (++tscm->push_pos >= SND_TSCM_QUEUE_COUNT)
 					tscm->push_pos = 0;
-				spin_unlock_irq(&tscm->lock);
+				spin_unlock_irqrestore(&tscm->lock, flag);
 
 				wake_up(&tscm->hwdep_wait);
 			}
-- 
2.20.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [alsa-devel] [PATCH] ALSA: firewire-tascam: fix corruption due to spin lock without restoration in SoftIRQ context
  2020-01-13  8:57 [alsa-devel] [PATCH] ALSA: firewire-tascam: fix corruption due to spin lock without restoration in SoftIRQ context Takashi Sakamoto
@ 2020-01-13  9:41 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2020-01-13  9:41 UTC (permalink / raw)
  To: Takashi Sakamoto; +Cc: alsa-devel, Scott Bahling, stable

On Mon, 13 Jan 2020 09:57:19 +0100,
Takashi Sakamoto wrote:
> 
> ALSA firewire-tascam driver can bring corruption due to spin lock without
> restoration of IRQ flag in SoftIRQ context. This commit fixes the bug.
> 
> Cc: Scott Bahling <sbahling@suse.com>
> Cc: <stable@vger.kernel.org> # v4.21
> Fixes: d7167422433c ("ALSA: firewire-tascam: queue events for change of control surface")
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

Applied, thanks.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-13  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13  8:57 [alsa-devel] [PATCH] ALSA: firewire-tascam: fix corruption due to spin lock without restoration in SoftIRQ context Takashi Sakamoto
2020-01-13  9:41 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).