Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7836076imu; Tue, 22 Jan 2019 12:29:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN4958+O+LLfaKRlPybEMVP90bg1TgZCSugGMAeeGrfLOxdA3nJ5gRJD8NQvc3iA+YQWWDXt X-Received: by 2002:a62:8985:: with SMTP id n5mr35254806pfk.255.1548188945764; Tue, 22 Jan 2019 12:29:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548188945; cv=none; d=google.com; s=arc-20160816; b=EBp+hbv/bfc7oMP/Xnpq0aAujN8nmQpfQylTmZQkbCSlmDv51jMS68Ow9N4BxliSxb p7NkJE0LXdXWiPUuuo7L53y7kRf5XwVDFHWJvMIk6hh+bNoV5iQmtMXWqBJAgwqO+XWb vTzo2k4PAAUMuxsNGsagkjLkcI/w1fYUUrPnsHGt/IPSzfzDcX+vgg+fZK5zh3wck2mu XkTVJG9jiaLK/noVVADkr/DuzveVxoLTjzVn3mtEHO2390IM1FZXfQYZFYjCaLsy3c26 2K3X0ZqaWaz48dSlsiMEyK7IFFXXtHIP2oj/q34H/CZbTVJws0AUcrLc4qhQExPD1n+4 nd4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ELWjOGU/W78hrlVNoDMF8p48A5w4hVSHYCPvuN4v6S0=; b=FEQ7EB2Eil+p+aZft4KnBrc5avKUCTT7l24RBWTfYP1G4crI8/DgMN6bYO/Ole66nT 5cajeipmwcTjj+d41C4ogyaQhsc+wotJctxMI0ayS86SYSHOCSccjDfA+c1JvIhnQjV5 vynjSeQARfYyKeGkMKC1DgOS37MyWGs7LUznDVNjlnfJqtazjG7eQNNv487F6fpBbAJr K/bbhEe9nmbeae+oKNdWyoBIX6Ah85kzuLbE+8jj4mtO5LpQs7Nzuh+t07DUJbnOse2W 6RDdkUAf6MopHUwSprGAWDmJiFjHivpVSBrxnxGohZ4SawM8DMPdP/RUEfE44yF4KYoE obww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=lgdK+M1O; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 191si16988393pgf.41.2019.01.22.12.28.49; Tue, 22 Jan 2019 12:29:05 -0800 (PST) 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; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=lgdK+M1O; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726359AbfAVU0G (ORCPT + 99 others); Tue, 22 Jan 2019 15:26:06 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:51344 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726009AbfAVU0F (ORCPT ); Tue, 22 Jan 2019 15:26:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ELWjOGU/W78hrlVNoDMF8p48A5w4hVSHYCPvuN4v6S0=; b=lgdK+M1Of4Vajtx/jOT8iavYj Efz+4BzyDiJ8mJlQheyz9zQ5mMWa60F/9kuOe2U2plpKgeAqbETVx39ishUIkpWDxPLok5LOY5rIc TrtkqUHxH4HjJM0cPPlOIMzJCfM8md9fvRZR/hIDKDjfPhWG/xe9FXg1oac6h9V+WLPb0=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1gm2c3-0007CE-S0; Tue, 22 Jan 2019 20:25:35 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 3E98A1127955; Tue, 22 Jan 2019 20:25:35 +0000 (GMT) Date: Tue, 22 Jan 2019 20:25:35 +0000 From: Mark Brown To: Jaroslav Kysela Cc: Takashi Iwai , alsa-devel@alsa-project.org, arnd@arndb.de, keescook@chromium.org, bgoswami@codeaurora.org, sr@denx.de, gustavo@embeddedor.com, philburk@google.com, willy@infradead.org, mchehab+samsung@kernel.org, sboyd@kernel.org, vkoul@kernel.org, Baolin Wang , daniel.thompson@linaro.org, leo.yan@linaro.org, mathieu.poirier@linaro.org, srinivas.kandagatla@linaro.org, anna-maria@linutronix.de, corbet@lwn.net, jmiller@neverware.com, ckeepax@opensource.wolfsonmicro.com, joe@perches.com, o-takashi@sakamocchi.jp, colyli@suse.de, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] ALSA: core: Add DMA share buffer support Message-ID: <20190122202535.GK7579@sirena.org.uk> References: <290f6d3a5fe288b87480cc5fa12c5139728daeca.1547787189.git.baolin.wang@linaro.org> <81e894ba-acad-2fd4-996d-8d35edd8825a@perex.cz> <20190118190805.GF6260@sirena.org.uk> <20190121124053.GA12679@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="huG+SbfbdD6eblZQ" Content-Disposition: inline In-Reply-To: X-Cookie: Truckers welcome. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --huG+SbfbdD6eblZQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jan 21, 2019 at 03:15:43PM +0100, Jaroslav Kysela wrote: > Dne 21.1.2019 v 13:40 Mark Brown napsal(a): > > It was the bit about adding more extended permission control that I was > > worried about there, not the initial O_APPEND bit. Indeed the O_APPEND > > bit sounds like it might also work from the base buffer sharing point of > > view, I have to confess I'd not heard of that feature before (it didn't > > come up in the discussion when Eric raised this in Prague). > With permissions, I meant to make possible to restrict the file > descriptor operations (ioctls) for the depending task (like access to > the DMA buffer, synchronize it for the non-coherent platforms and maybe > read/write the actual position, delay etc.). It should be relatively > easy to implement using the snd_pcm_file structure. Right, that's what I understood you to mean. If you want to have a policy saying "it's OK to export a PCM file descriptor if it's only got permissions X and Y" the security module is going to need to know about the mechanism for setting those permissions. With dma_buf that's all a bit easier as there's less new stuff, though I've no real idea how much of a big deal that actually is. > Even with the full operation mode, it's difficult imagine what the > depending task can break with the sound interface except probably annoy > users with some cracks for the playback or start/stop the streaming rapidly. In some embedded systems the ability to play back notifications clearly can be very important to system functionality. Obviously at times the main purpose of the system is to play or record audio. I don't have a *super* strong opinion here but I'm not really a security person. --huG+SbfbdD6eblZQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlxHfD4ACgkQJNaLcl1U h9Bi/gf/RX3fSAWWGh9peNObRd7J19zaw9F/D2+LAK882ygexXi+46clqp5voXp0 9ayUdE4ZGQEkJ7OMO9HFdBZLvWWwVdcovK9EPrWDKhEUzjZbmU71ZSrIqYm4eEyV NHmJGrsWUMulWJsxsYmtAf+AF9uEke0/nWHSZlu7v26FIlihpZKx99IrBq3D5egh 6934PlTzIc7gzt2HFMRbeX7Wi8dQ+YyffoZ73kxjYENud7WbyC6tqWaWsihlApl7 T3mOL3UQx8DRCDwsR1zGbv2ECnjniTvuBPIFmuNB89jWWivjnQ7qdyasFR5i7Vw7 k7LxSzKlzpjvgPcFZSMwoFnXdPRN5Q== =D6GE -----END PGP SIGNATURE----- --huG+SbfbdD6eblZQ--