From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D9C9C433FF for ; Mon, 29 Jul 2019 05:49:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 289142070B for ; Mon, 29 Jul 2019 05:49:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726780AbfG2FtZ (ORCPT ); Mon, 29 Jul 2019 01:49:25 -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