]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/5.1.12/revert-alsa-seq-protect-in-kernel-ioctl-calls-with-m.patch
Linux 5.1.12
[thirdparty/kernel/stable-queue.git] / releases / 5.1.12 / revert-alsa-seq-protect-in-kernel-ioctl-calls-with-m.patch
CommitLineData
fb43722c
SL
1From a40a52b3eae3d5b2cfcb6a3c1b48cde900928886 Mon Sep 17 00:00:00 2001
2From: Takashi Iwai <tiwai@suse.de>
3Date: Thu, 11 Apr 2019 19:58:32 +0200
4Subject: Revert "ALSA: seq: Protect in-kernel ioctl calls with mutex"
5
6[ Upstream commit f0654ba94e33699b295ce4f3dc73094db6209035 ]
7
8This reverts commit feb689025fbb6f0aa6297d3ddf97de945ea4ad32.
9
10The fix attempt was incorrect, leading to the mutex deadlock through
11the close of OSS sequencer client. The proper fix needs more
12consideration, so let's revert it now.
13
14Fixes: feb689025fbb ("ALSA: seq: Protect in-kernel ioctl calls with mutex")
15Reported-by: syzbot+47ded6c0f23016cde310@syzkaller.appspotmail.com
16Signed-off-by: Takashi Iwai <tiwai@suse.de>
17Signed-off-by: Sasha Levin <sashal@kernel.org>
18---
19 sound/core/seq/seq_clientmgr.c | 9 ++-------
20 1 file changed, 2 insertions(+), 7 deletions(-)
21
22diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
23index 8599f2937ac1..c99e1b77a45b 100644
24--- a/sound/core/seq/seq_clientmgr.c
25+++ b/sound/core/seq/seq_clientmgr.c
26@@ -2337,19 +2337,14 @@ int snd_seq_kernel_client_ctl(int clientid, unsigned int cmd, void *arg)
27 {
28 const struct ioctl_handler *handler;
29 struct snd_seq_client *client;
30- int err;
31
32 client = clientptr(clientid);
33 if (client == NULL)
34 return -ENXIO;
35
36 for (handler = ioctl_handlers; handler->cmd > 0; ++handler) {
37- if (handler->cmd == cmd) {
38- mutex_lock(&client->ioctl_mutex);
39- err = handler->func(client, arg);
40- mutex_unlock(&client->ioctl_mutex);
41- return err;
42- }
43+ if (handler->cmd == cmd)
44+ return handler->func(client, arg);
45 }
46
47 pr_debug("ALSA: seq unknown ioctl() 0x%x (type='%c', number=0x%02x)\n",
48--
492.20.1
50