Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3010698ybi; Mon, 17 Jun 2019 14:37:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmLo2C+1NHsHChrFIRww1ZX9T27CvepWJElbdGDLVbqRV6bMsC8uBl38rPhIyxspY9oTxJ X-Received: by 2002:a17:90a:5d09:: with SMTP id s9mr1198406pji.120.1560807461927; Mon, 17 Jun 2019 14:37:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560807461; cv=none; d=google.com; s=arc-20160816; b=UxqDNu50EljveRm1dsK1Dz8W0kXA+KqGdE6OzEHP8d3qD5zg6ryPq0INwY7p0cGSmc v9qtv4rCQPyIq9CBlacQ/Xj7r6x079C12XeR8pEHaMiSAyabl6gFFqc1RilAcKXyKQI3 EnxUWqcVeZgCZDaTcxTtxRdDtgWE5Xk66+eS4yGWTOp54ftxLKmhLUOWjZ8JW0AatAJP TT8tWesJyltJi6wAtkubQPXoGbfKYztSjyinFgJpllCFKCeBgIn6ioDHQWrcOhYc+jTV JTJtxfbZzp3Mit2ajTd6K3XvdE7wRBFmsD+C6DHPLyFrs6j9td7ZWRVUDjGhA8AXGx0t 0EkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gpggaHvDGkLaz9xVzBEGdHjZjRaO1TzGUaPxm7bTfw8=; b=HlgkvIkLuc7xTWOKwxF3w/mLYBQSxG7zHE3U3wu51sDu/zCSfo8JsuAYV0LpKWOWoL qg8tSUS6uUXhiMwxYlHJ9sTQf62dJ/Kosbp0lrtEBinSxIVm4JYp70iQACH8wGd/gJxp DokH9zgqgb+a3aAN/HG3428oej+vd9foIpW8pTcGUB5PjyGB+j3pP/NgL31QhodkYawY SK5RfuwewtUUwYNZw9X9VXj11l7vSSbMmAcOUtVuM5z1wwgcwbRr2EfM+S4peL+MYfr7 rnO88UexTJsnR2KkoliAo7D+7YdtWsZkZcz/7xrV4ggj4c/n5GjkkFna9BM3qMgEvSaj Wubw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Jq/FYL3+"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j11si5518613pfi.279.2019.06.17.14.37.26; Mon, 17 Jun 2019 14:37:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Jq/FYL3+"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729616AbfFQVgJ (ORCPT + 99 others); Mon, 17 Jun 2019 17:36:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:46656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729462AbfFQVWF (ORCPT ); Mon, 17 Jun 2019 17:22:05 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A2518208CB; Mon, 17 Jun 2019 21:22:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560806525; bh=spFdKtBn734P0rF1qx0cgEPcZGvSaAAFlKMTfzB/c04=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jq/FYL3+rv4VfHQKi04BTe2gKWUQ7azsMaLUuClocCJyroZZr8Sco2v/R9b4Avmd+ jmuqoNBNW9r9GLVfxMgAXAhvF1wCt/a+eYvq2IaG/2xJYnlYZzIyBORyve2CORf6+o cN0HKZNT1YP2BWkjwzJZ5r5ehSVZvddUDxdfeTPQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+47ded6c0f23016cde310@syzkaller.appspotmail.com, Takashi Iwai , Sasha Levin Subject: [PATCH 5.1 045/115] Revert "ALSA: seq: Protect in-kernel ioctl calls with mutex" Date: Mon, 17 Jun 2019 23:09:05 +0200 Message-Id: <20190617210802.581623298@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190617210759.929316339@linuxfoundation.org> References: <20190617210759.929316339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit f0654ba94e33699b295ce4f3dc73094db6209035 ] 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 Signed-off-by: Sasha Levin --- sound/core/seq/seq_clientmgr.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index 8599f2937ac1..c99e1b77a45b 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c @@ -2337,19 +2337,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", -- 2.20.1