Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3000350ybi; Sun, 28 Jul 2019 22:50:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKB1JgZjPGLoAA1hZljeBgMHkuWjpo2DBvVYhZYu6Uh3sKhDEleTw/MybkJh+IJtGveZ3k X-Received: by 2002:a65:5144:: with SMTP id g4mr50188509pgq.202.1564379438404; Sun, 28 Jul 2019 22:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564379438; cv=none; d=google.com; s=arc-20160816; b=yp/y/LStaxU+SeGiTdj6TEXlOhlkofQlpEIF0BNiBkUOYebkMSuVXfoYu8IODbS1d+ YaoAVq1+CV2oPCD+i37FZddyv0Uhe1LYcBFu7x1E70qpX7GY6QyJUlAr/7cLPGLJ/oXA IJ3tbhlmpM8fns5HmJ0+lORbdmfkDG84qUsmOtL/oEk0WJlaC7nrbYjuYJJ6l8WuWw4W mPrZF4PK/Qjn77dmOQkqjlCo8xWiuofsk1uAo64n/7pvta8UgffN52lguWyQ4ilJuxVa 81eVuG6cEnJKvQsEfpyr7GEtHCi1RyKYpIZjz3T149+Y1q12YVXbgdECd4C61Nn6iWa2 UwgQ== 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:subject:cc:to:from:message-id :date; bh=0zhX+Q04givroA2oO/pYb6iscUWUcCCEHZTwVjziVSs=; b=oO9wSk9V5U71jhld2VT8hsEppTbkU5RrmHutSaEs2jMJoO5f9jPVuC63guoJbcyULi QckPMkBttPlrf0FB30RhrL47SM/IsutJCBUPJC86aL6QSS+d7/CovJvfjh/nUC3cEegd 23ZKz1E64HEGuXvpiFRl0/tCmqIQOcPLfz2kVJNJAZMhfNBO/BWVD83ffgCK5eU7D/nq Zihb9tISPjxmMETYY0NQ4FMTft0fJ532ibdUYg/7dyr0AdbCis3+c17ZnXjBYwEPxubq hiyMANLVk0qsAyTxzkj38mcoQXWvgwat/rytPanFshBslsY76usq7r3X4s3CDzquOUIt FL8g== ARC-Authentication-Results: i=1; mx.google.com; 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 y7si26003259pgi.401.2019.07.28.22.50.22; Sun, 28 Jul 2019 22:50:38 -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; 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 S1726767AbfG2FtY (ORCPT + 99 others); Mon, 29 Jul 2019 01:49:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:39720 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725988AbfG2FtY (ORCPT ); Mon, 29 Jul 2019 01:49:24 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 76282AEAE; Mon, 29 Jul 2019 05:49:23 +0000 (UTC) Date: Mon, 29 Jul 2019 07:49:23 +0200 Message-ID: From: Takashi Iwai To: Jia-Ju Bai Cc: perex@perex.cz, gregkh@linuxfoundation.org, rfontana@redhat.com, allison@lohutok.net, tglx@linutronix.de, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [BUG] ALSA: core: seq: a possible double-lock bug in snd_seq_midisynth_remove() In-Reply-To: <50b3b4c4-fe36-8c65-345b-f0a51193726c@gmail.com> References: <50b3b4c4-fe36-8c65-345b-f0a51193726c@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") 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 On Mon, 29 Jul 2019 05:54:07 +0200, Jia-Ju Bai wrote: > > In snd_seq_midisynth_remove(), there is a possible double-lock bug: > snd_seq_midisynth_remove() >     mutex_lock(®ister_mutex); -- line 421 >     snd_seq_delete_kernel_client() --- line 436 >         seq_free_client() -- line 2244 >             mutex_lock(®ister_mutex); -- line 294 > > This bug is found by a static analysis tool STCheck written by us. No, it's a false-positive report. Both register_mutex's are static, hence they are local to each file. That is, you're looking at two different mutexes. Takashi