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 9F856C2FC0E for ; Thu, 17 Aug 2023 07:29:11 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0736D82B; Thu, 17 Aug 2023 09:28:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0736D82B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1692257349; bh=ZGhGmO7BiybiS4EEZfGzut6EtCvNnmf3CRzjWmzgGF4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bjZh0xNS6XlIZkWtaGPwyMyCU2BnL+phNJV9bFa5UkunVNSMG8JVBdho8zIsZAlC3 XLVS+mt2bU3pNDCoqAAvzOlmzDms7De10Z/KF7Tj+bpE4CJOnezGiVpX3AKQ7SFDnX EZxJO/9NCisFFYFgGSHJGxSd52gO67fmUGrD2sx8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 77B93F80536; Thu, 17 Aug 2023 09:27:43 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 2A3F9F8016D; Thu, 17 Aug 2023 09:27:43 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D1059F8016D; Thu, 17 Aug 2023 09:27:39 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6B399F80027 for ; Thu, 17 Aug 2023 09:27:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6B399F80027 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=Cxh/Sizf; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=jyeDFq+H 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-out1.suse.de (Postfix) with ESMTPS id 3861B215E6; Thu, 17 Aug 2023 07:27:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1692257256; 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=OG2M480JqD4BTvzCJtOCL6V9JYEtpfxQda1D8331XFg=; b=Cxh/SizfHLCg17Bphr2XdcIxS+ujrirPO6T1FCsTJLC8OgHuYyzymOdBtW9hYxRNk4759I 0r9f0ltXjzqu8uRrHmHTSjLSpzpLec0vxrZUn1z1KGY/wp67cClRX3hdR8pa5ckaVUfmmM FTzshYJJZlzODS8/n1qhCl/MaJiSe+8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1692257256; 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=OG2M480JqD4BTvzCJtOCL6V9JYEtpfxQda1D8331XFg=; b=jyeDFq+Hu7CYnFtVQaGr7o7kYx6qmML1eUKOiHLd9NaddNrQGovw3VerylEzbNluibLhEK wUp8RuuJWI2bfgDg== 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 1CB5F1358B; Thu, 17 Aug 2023 07:27:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 1BbrBejL3WR8NgAAMHmgww (envelope-from ); Thu, 17 Aug 2023 07:27:36 +0000 Date: Thu, 17 Aug 2023 09:27:35 +0200 Message-ID: <874jkyw2l4.wl-tiwai@suse.de> From: Takashi Iwai To: alsa-devel@alsa-project.org Cc: Curtis Malainey Subject: Re: [PATCH RFC 0/9] ALSA: Don't embed struct devices In-Reply-To: <20230816160252.23396-1-tiwai@suse.de> References: <20230816160252.23396-1-tiwai@suse.de> 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 Message-ID-Hash: BHLZYZEI5L6UPM3QNS6KUBZOFGGTWNCN X-Message-ID-Hash: BHLZYZEI5L6UPM3QNS6KUBZOFGGTWNCN X-MailFrom: tiwai@suse.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, 16 Aug 2023 18:02:43 +0200, Takashi Iwai wrote: > > Hi, > > this is another set of patches to attempt papering over the UAF > problems that are seen when the delayed kobject release is enabled, as > initially reported by Curtis: > https://lore.kernel.org/r/20230801171928.1460120-1-cujomalainey@chromium.org > > There was a previous patch set with a different approach (using the > device refcount dependencies), but this is a sort of step-back to the > old way. > https://lore.kernel.org/r/20230807135207.17708-1-tiwai@suse.de > > After discussions and evaluations, we agreed that decoupling the > struct device from each sound component object is the safest (and > easiest) way as of now. For applying the changes more consistently, I > introduced a new helper for the struct device allocation and > initialization, and applied all components. > > A couple of more changes for card_dev refcount managed aren't included > in this patch set, though. They might be good to have, but this patch > set should suffice for the currently seen UAF problems. > > For a long-term solution, we may restructure the device management, > then the struct devices may be embedded again in each object. But, > it'll need lots of other changes and cleanups, a big TODO. > > The latest patches are found in topic/dev-split branch of sound.git > tree. > > > Takashi > > === > > Takashi Iwai (9): > ALSA: core: Introduce snd_device_alloc() > ALSA: control: Don't embed ctl_dev > ALSA: pcm: Don't embed device > ALSA: hwdep: Don't embed device > ALSA: rawmidi: Don't embed device > ALSA: compress: Don't embed device > ALSA: timer: Create device with snd_device_alloc() > ALSA: seq: Create device with snd_device_alloc() > ALSA: core: Drop snd_device_initialize() Although the patch set was sent as RFC, I merged them now for 6.6 with Acks, as there is no further plan to change. thanks, Takashi