]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Jun 2019 09:11:50 +0000 (11:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Jun 2019 09:11:50 +0000 (11:11 +0200)
added patches:
alsa-seq-cover-unsubscribe_port-in-list_mutex.patch

queue-4.4/alsa-seq-cover-unsubscribe_port-in-list_mutex.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/alsa-seq-cover-unsubscribe_port-in-list_mutex.patch b/queue-4.4/alsa-seq-cover-unsubscribe_port-in-list_mutex.patch
new file mode 100644 (file)
index 0000000..9ee4b66
--- /dev/null
@@ -0,0 +1,37 @@
+From 7c32ae35fbf9cffb7aa3736f44dec10c944ca18e Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Fri, 12 Apr 2019 11:37:19 +0200
+Subject: ALSA: seq: Cover unsubscribe_port() in list_mutex
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 7c32ae35fbf9cffb7aa3736f44dec10c944ca18e upstream.
+
+The call of unsubscribe_port() which manages the group count and
+module refcount from delete_and_unsubscribe_port() looks racy; it's
+not covered by the group list lock, and it's likely a cause of the
+reported unbalance at port deletion.  Let's move the call inside the
+group list_mutex to plug the hole.
+
+Reported-by: syzbot+e4c8abb920efa77bace9@syzkaller.appspotmail.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/core/seq/seq_ports.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/sound/core/seq/seq_ports.c
++++ b/sound/core/seq/seq_ports.c
+@@ -550,10 +550,10 @@ static void delete_and_unsubscribe_port(
+               list_del_init(list);
+       grp->exclusive = 0;
+       write_unlock_irq(&grp->list_lock);
+-      up_write(&grp->list_mutex);
+       if (!empty)
+               unsubscribe_port(client, port, grp, &subs->info, ack);
++      up_write(&grp->list_mutex);
+ }
+ /* connect two ports */
index 7d89272215bb2b86ec2cd7e0370d47318ef62d52..a252fea5deca89d8b0a7a1f5a9737b61e1991e9b 100644 (file)
@@ -39,3 +39,4 @@ pwm-fix-deadlock-warning-when-removing-pwm-device.patch
 arm-exynos-fix-undefined-instruction-during-exynos54.patch
 futex-fix-futex-lock-the-wrong-page.patch
 revert-bluetooth-align-minimum-encryption-key-size-for-le-and-br-edr-connections.patch
+alsa-seq-cover-unsubscribe_port-in-list_mutex.patch