]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Revert "ALSA: seq: Protect in-kernel ioctl calls with mutex"
authorTakashi Iwai <tiwai@suse.de>
Thu, 11 Apr 2019 17:58:32 +0000 (19:58 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 11 Apr 2019 17:58:43 +0000 (19:58 +0200)
This reverts commit feb689025fbb6f0aa6297d3ddf97de945ea4ad32.

The fix attempt was incorrect, leading to the mutex deadlock through
the close of OSS sequencer client.  The proper fix needs more
consideration, so let's revert it now.

Fixes: feb689025fbb ("ALSA: seq: Protect in-kernel ioctl calls with mutex")
Reported-by: syzbot+47ded6c0f23016cde310@syzkaller.appspotmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/seq/seq_clientmgr.c

index f256704dc401ff1288bdac2a4a0c1c26839c6b96..de320b1b90deb157afdd9520f95685c1286f6e7a 100644 (file)
@@ -2334,19 +2334,14 @@ int snd_seq_kernel_client_ctl(int clientid, unsigned int cmd, void *arg)
 {
        const struct ioctl_handler *handler;
        struct snd_seq_client *client;
-       int err;
 
        client = clientptr(clientid);
        if (client == NULL)
                return -ENXIO;
 
        for (handler = ioctl_handlers; handler->cmd > 0; ++handler) {
-               if (handler->cmd == cmd) {
-                       mutex_lock(&client->ioctl_mutex);
-                       err = handler->func(client, arg);
-                       mutex_unlock(&client->ioctl_mutex);
-                       return err;
-               }
+               if (handler->cmd == cmd)
+                       return handler->func(client, arg);
        }
 
        pr_debug("ALSA: seq unknown ioctl() 0x%x (type='%c', number=0x%02x)\n",