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=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 1D36CC17440 for ; Tue, 12 Nov 2019 18:17:53 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1A07C21A49 for ; Tue, 12 Nov 2019 18:17:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Cou4GdAo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A07C21A49 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 945F5820; Tue, 12 Nov 2019 19:16:59 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 945F5820 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1573582669; bh=XNbNfz2IchRjSHyiEhYQec7pJRzWU/BGEqzayUwisBE=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Cou4GdAotb7LrKDWQN7a/YxtS+cJKMV8B8ztd3y/p0fdlZHNFq5TKaRsM4qqOY3Mj nrizGoRL79BkOGH6IxoffRnfVBeIhjsydCS7BhsNSSiSp3tamKz0wBBXGHnn9Atn+v JU0Q8tuiZ/O+GNo5EkU87eSS8HmpS29M2s02KUj0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2E3C4F8044C; Tue, 12 Nov 2019 19:16:59 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B1811F80483; Tue, 12 Nov 2019 19:16:58 +0100 (CET) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 730E4F802E0 for ; Tue, 12 Nov 2019 19:16:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 730E4F802E0 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 D30FBB1B2; Tue, 12 Nov 2019 18:16:50 +0000 (UTC) Date: Tue, 12 Nov 2019 19:16:50 +0100 Message-ID: From: Takashi Iwai To: paulhsia In-Reply-To: <20191112171715.128727-1-paulhsia@chromium.org> References: <20191112171715.128727-1-paulhsia@chromium.org> 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") Cc: alsa-devel@alsa-project.org, Mark Brown , linux-kernel@vger.kernel.org, Takashi Iwai Subject: Re: [alsa-devel] [PATCH 0/2] ALSA: pcm: Fix race condition in runtime access X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, 12 Nov 2019 18:17:13 +0100, paulhsia wrote: > > Since > - snd_pcm_detach_substream sets runtime to null without stream lock and > - snd_pcm_period_elapsed checks the nullity of the runtime outside of > stream lock. > > This will trigger null memory access in snd_pcm_running() call in > snd_pcm_period_elapsed. Well, if a stream is detached, it means that the stream must have been already closed; i.e. it's already a clear bug in the driver that snd_pcm_period_elapsed() is called against such a stream. Or am I missing other possible case? thanks, Takashi > > paulhsia (2): > ALSA: pcm: Fix stream lock usage in snd_pcm_period_elapsed() > ALSA: pcm: Use stream lock in snd_pcm_detach_substream() > > sound/core/pcm.c | 8 +++++++- > sound/core/pcm_lib.c | 8 ++++++-- > 2 files changed, 13 insertions(+), 3 deletions(-) > > -- > 2.24.0.rc1.363.gb1bccd3e3d-goog > _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel