]>
Commit | Line | Data |
---|---|---|
2289b8c5 SL |
1 | From 207b3c11e76dcbffe76539c6a1fb24df126e7eae Mon Sep 17 00:00:00 2001 |
2 | From: Takashi Iwai <tiwai@suse.de> | |
3 | Date: Thu, 11 Apr 2019 19:58:32 +0200 | |
4 | Subject: Revert "ALSA: seq: Protect in-kernel ioctl calls with mutex" | |
5 | ||
6 | [ Upstream commit f0654ba94e33699b295ce4f3dc73094db6209035 ] | |
7 | ||
8 | This reverts commit feb689025fbb6f0aa6297d3ddf97de945ea4ad32. | |
9 | ||
10 | The fix attempt was incorrect, leading to the mutex deadlock through | |
11 | the close of OSS sequencer client. The proper fix needs more | |
12 | consideration, so let's revert it now. | |
13 | ||
14 | Fixes: feb689025fbb ("ALSA: seq: Protect in-kernel ioctl calls with mutex") | |
15 | Reported-by: syzbot+47ded6c0f23016cde310@syzkaller.appspotmail.com | |
16 | Signed-off-by: Takashi Iwai <tiwai@suse.de> | |
17 | Signed-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 | ||
22 | diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c | |
23 | index 37312a3ae60f..f59e13c1d84a 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 | -- | |
49 | 2.20.1 | |
50 |