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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E63F7C433EF for ; Wed, 24 Nov 2021 12:34:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229978AbhKXMh1 (ORCPT ); Wed, 24 Nov 2021 07:37:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:49474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344256AbhKXMam (ORCPT ); Wed, 24 Nov 2021 07:30:42 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 076FF61131; Wed, 24 Nov 2021 12:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637756353; bh=ORdil0lSCH5niHK5ARiMh6xV9T34JDvnkZDM1a6Q37c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rTsLS2PwHVk4v3jgyGWD3C8ykeOP7trl0W497HQxHt1p+SAt2CfLeFbqoIJOqlRYr jyw2gnR5KipisJJ3I91q3bNWaA5pPkJMMfN63w5aSOC6Xk75snApr0+isnh4LR4kX4 k+2HczKWsgCFrr6rtn+zS7eYo1fEDrW9N4CKyxfE= 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 4.14 056/251] ALSA: mixer: fix deadlock in snd_mixer_oss_set_volume Date: Wed, 24 Nov 2021 12:54:58 +0100 Message-Id: <20211124115712.196279347@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115710.214900256@linuxfoundation.org> References: <20211124115710.214900256@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 @@ -328,7 +328,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; }