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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A9ACEC07E9D for ; Mon, 26 Sep 2022 16:06:12 +0000 (UTC) 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 4809D868; Mon, 26 Sep 2022 18:05:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4809D868 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664208370; bh=eIKzv0XkrnUgnwNIUBMKcA2LkErhOBiRWd40tK7W7xE=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Um98paOGn6Ml7qphh6jyrNvekEzjZDDmSkRZeXJ0BV0R4rgQxsoRCjFQlCdWw0iK6 GFZ5clBrXEOPXA7nvozyBOvzWAonAdxU1FOwBv0TCaMi22/yeMU/+xGY+mef7A+uFR +a5Et6YLNxrWyoz6TLY/pHZlX2Op8N1Ag1VlO9Mc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C9486F80254; Mon, 26 Sep 2022 18:05:19 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 70539F8027D; Mon, 26 Sep 2022 18:05:18 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 60A3DF80115 for ; Mon, 26 Sep 2022 18:05:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 60A3DF80115 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="V8XmHwFe"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="6Fy/nc7O" Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B68241F390; Mon, 26 Sep 2022 16:05:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664208313; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WhtoqmGdA9Y2LiCVfdShbzqQTiHt7lP/K80+W8fiR+o=; b=V8XmHwFeOQ+NDByhPjBrnQAsQIURWl4GHTFFVIsu5XOmRmp6ZCOme8vEmc1WVTBrZ5M8SS 3KyA8+u9G89v7xaJG8K+f0gT9hViQeZ+JwCisYH6ZvFFM+YE0JTU36I89zLl9BaZ0AtXFe 3Iq3oDodcwniqpHnlguZzpg1lZVJEP0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664208313; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WhtoqmGdA9Y2LiCVfdShbzqQTiHt7lP/K80+W8fiR+o=; b=6Fy/nc7OXpRqz9BwpoQSqs16we/mxgC6NVcZHcQs2p+bcm0J6ONTQvpSaNJvur+5vtio6R KJAMDYIMy6MbaQBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9F7FF139BD; Mon, 26 Sep 2022 16:05:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id uV1SJrnNMWOtNAAAMHmgww (envelope-from ); Mon, 26 Sep 2022 16:05:13 +0000 Date: Mon, 26 Sep 2022 18:05:13 +0200 Message-ID: <87r0zyglza.wl-tiwai@suse.de> From: Takashi Iwai To: Jaroslav Kysela Subject: Re: [PATCH 00/11] ALSA: PCM state reference optimization In-Reply-To: <3d89afec-26fb-a92b-4dd7-76a09739e066@perex.cz> References: <20220926135558.26580-1-tiwai@suse.de> <3d89afec-26fb-a92b-4dd7-76a09739e066@perex.cz> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Cc: ALSA development 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Mon, 26 Sep 2022 17:56:15 +0200, Jaroslav Kysela wrote: > > On 26. 09. 22 15:55, Takashi Iwai wrote: > > Hi, > > > > this is a patch set for simplifying the reference to the current PCM > > state by having the local copy in runtime instead of relying on > > runtime->status indirection. This also hardens against the attack by > > modifying the mmapped status record. > > > > The first patch does the basic job in the core PCM side, and the > > second patch flips the PCM status mmap to read-only for hardening, > > while the remaining patches are for drivers to follow the core > > change. > > > > The conversions are straightforward. In most places, it's just > > replacing runtime->status->state with runtime->state. > > > > > > Takashi > > > > === > > > > Takashi Iwai (11): > > ALSA: pcm: Avoid reference to status->state > > ALSA: pcm: Make mmap status read-only > > ALSA: aloop: Replace runtime->status->state reference to > > runtime->state > > ALSA: firewire: Replace runtime->status->state reference to > > runtime->state > > ALSA: hda: Replace runtime->status->state reference to runtime->state > > ALSA: asihpi: Replace runtime->status->state reference to > > runtime->state > > ALSA: usb-audio: Replace runtime->status->state reference to > > runtime->state > > ALSA: usx2y: Replace runtime->status->state reference to > > runtime->state > > ASoC: intel: Replace runtime->status->state reference to > > runtime->state > > ASoC: sh: Replace runtime->status->state reference to runtime->state > > usb: gadget: Replace runtime->status->state reference to > > runtime->state > > Nice cleanup. Perhaps, you may add a note to the second patch that the > status is already mmaped as read-only in alsa-lib for ages. So no > regressions are expected. Makes sense. Will add some text. thanks, Takashi