Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EB53C433F5 for ; Tue, 16 Nov 2021 02:14:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 580296137F for ; Tue, 16 Nov 2021 02:14:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351869AbhKPCRF (ORCPT ); Mon, 15 Nov 2021 21:17:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:34892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238846AbhKORrs (ORCPT ); Mon, 15 Nov 2021 12:47:48 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6C9466329F; Mon, 15 Nov 2021 17:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1636997402; bh=3UtydLdEJfmraCHWQm0ERCQAxWACsBN7HaPESruk6fA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZG+aGINf0Kd3do/dnm6NTbZsJ/oCUzGTXhY5jROnayffwUZ9ZE78onwFKELLNkuP1 dGPm7V7tFdgYvcJeiUxFPAE5laAq3443SKbn/0uQywUXoWg0l39Xfzt4Jp/f8Ck+I4 AJYmyMOEpILuo24CQh6havjFfi0NMcFm1P2GTke8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+ace149a75a9a0a399ac7@syzkaller.appspotmail.com, Pavel Skripkin , Takashi Iwai Subject: [PATCH 5.10 135/575] ALSA: mixer: fix deadlock in snd_mixer_oss_set_volume Date: Mon, 15 Nov 2021 17:57:40 +0100 Message-Id: <20211115165348.372003656@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211115165343.579890274@linuxfoundation.org> References: <20211115165343.579890274@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Skripkin commit 3ab7992018455ac63c33e9b3eaa7264e293e40f4 upstream. In commit 411cef6adfb3 ("ALSA: mixer: oss: Fix racy access to slots") added mutex protection in snd_mixer_oss_set_volume(). Second mutex_lock() in same function looks like typo, fix it. Reported-by: syzbot+ace149a75a9a0a399ac7@syzkaller.appspotmail.com Fixes: 411cef6adfb3 ("ALSA: mixer: oss: Fix racy access to slots") Cc: Signed-off-by: Pavel Skripkin Link: https://lore.kernel.org/r/20211024140315.16704-1-paskripkin@gmail.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/core/oss/mixer_oss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c @@ -313,7 +313,7 @@ static int snd_mixer_oss_set_volume(stru pslot->volume[1] = right; result = (left & 0xff) | ((right & 0xff) << 8); unlock: - mutex_lock(&mixer->reg_mutex); + mutex_unlock(&mixer->reg_mutex); return result; }