* [PATCH v6 0/3] ALSA: pcm: anonymous dup implementation
@ 2019-02-04 18:38 Jaroslav Kysela
2019-02-07 16:29 ` Mark Brown
2019-02-08 16:14 ` Takashi Iwai
0 siblings, 2 replies; 4+ messages in thread
From: Jaroslav Kysela @ 2019-02-04 18:38 UTC (permalink / raw)
To: ALSA development
Cc: Baolin Wang, Takashi Iwai, Phil Burk, Zach Riggle, Mark Brown,
Leo Yan
This patchset contains the anonymous dup implementation with permissions
checking for the ALSA's PCM interface in kernel to enable the restricted
DMA sound buffer sharing for the restricted tasks.
The code was tested through qemu and it seems to be pretty stable.
The initial tinyalsa implementation can be found here:
https://github.com/perexg/tinyalsa/commits/anondup
The filtering might be refined. It depends on the real requirements.
Perhaps, we may create more ioctl groups. Any comments are more than
welcome.
v2 of the patches:
- change clone parameter to subdevice number for the pcm attach
- change SNDRV_PCM_PERM_MAX to SNDRV_PCM_PERM_MASK
- the tinyalsa implementation was a little updated (restructured)
v3 of the patches:
- group integer declarations in snd_pcm_anonymous_dup()
- replaced substream->pcm with pcm in snd_pcm_anonymous_dup()
- added SNDRV_PCM_PERM_RW check for read/write/readv/writev syscalls
v4 of the patches:
- more simple restriction control (only two modes - full/buffer)
- the tinyalsa implementation follows this change
v5 of the patches:
- merge pcm_..._mmap_allowed fcns to the snd_pcm_mmap_... fcns
v6:
- add proper open_mutex protection for snd_pcm_open_file()
Cc: Phil Burk <philburk@google.com>
Cc: Zach Riggle <riggle@google.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Baolin Wang <baolin.wang@linaro.org>
Jaroslav Kysela (3):
ALSA: pcm: implement the anonymous dup (inode file descriptor)
ALSA: pcm: merge pcm_..._mmap_allowed fcns to the snd_pcm_mmap_...
fcns
ALSA: pcm: implement the mmap buffer mode for the anonymous dup
include/sound/pcm.h | 10 +--
include/uapi/sound/asound.h | 6 +-
sound/core/oss/pcm_oss.c | 2 +-
sound/core/pcm.c | 13 ++--
sound/core/pcm_compat.c | 1 +
sound/core/pcm_native.c | 154 +++++++++++++++++++++++++++++++++-----------
6 files changed, 133 insertions(+), 53 deletions(-)
--
2.13.6
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v6 0/3] ALSA: pcm: anonymous dup implementation
@ 2019-02-05 18:24 Ricardo Biehl Pasquali
0 siblings, 0 replies; 4+ messages in thread
From: Ricardo Biehl Pasquali @ 2019-02-05 18:24 UTC (permalink / raw)
To: perex; +Cc: alsa-devel
What about file sealing?
See:
Jonathan Corbet's article about sealed files (2014-04-09).
<https://lwn.net/Articles/593918/>.
Theodore Ts'o reply to file sealing patch suggesting an
implementation on VFS (2014-03-20).
Re: [PATCH 0/6] File Sealing & memfd_create()
<https://lwn.net/Articles/593963/>.
pasquali
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v6 0/3] ALSA: pcm: anonymous dup implementation
2019-02-04 18:38 Jaroslav Kysela
@ 2019-02-07 16:29 ` Mark Brown
2019-02-08 16:14 ` Takashi Iwai
1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2019-02-07 16:29 UTC (permalink / raw)
To: Jaroslav Kysela
Cc: ALSA development, Baolin Wang, Takashi Iwai, Phil Burk,
Zach Riggle, Leo Yan
[-- Attachment #1.1: Type: text/plain, Size: 314 bytes --]
On Mon, Feb 04, 2019 at 07:38:14PM +0100, Jaroslav Kysela wrote:
> This patchset contains the anonymous dup implementation with permissions
> checking for the ALSA's PCM interface in kernel to enable the restricted
> DMA sound buffer sharing for the restricted tasks.
Reviewed-by: Mark Brown <broonie@kernel.org>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v6 0/3] ALSA: pcm: anonymous dup implementation
2019-02-04 18:38 Jaroslav Kysela
2019-02-07 16:29 ` Mark Brown
@ 2019-02-08 16:14 ` Takashi Iwai
1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2019-02-08 16:14 UTC (permalink / raw)
To: Jaroslav Kysela
Cc: ALSA development, Baolin Wang, Phil Burk, Zach Riggle, Mark Brown,
Leo Yan
On Mon, 04 Feb 2019 19:38:14 +0100,
Jaroslav Kysela wrote:
>
> This patchset contains the anonymous dup implementation with permissions
> checking for the ALSA's PCM interface in kernel to enable the restricted
> DMA sound buffer sharing for the restricted tasks.
>
> The code was tested through qemu and it seems to be pretty stable.
>
> The initial tinyalsa implementation can be found here:
>
> https://github.com/perexg/tinyalsa/commits/anondup
>
> The filtering might be refined. It depends on the real requirements.
> Perhaps, we may create more ioctl groups. Any comments are more than
> welcome.
Is this patchset targeted for 5.1 merge?
I hesitate to merge it for now, as the new API hasn't been tested much
yet... If it's for 5.1, we need test coverage and more reviews
quickly.
thanks,
Takashi
>
> v2 of the patches:
>
> - change clone parameter to subdevice number for the pcm attach
> - change SNDRV_PCM_PERM_MAX to SNDRV_PCM_PERM_MASK
> - the tinyalsa implementation was a little updated (restructured)
>
> v3 of the patches:
>
> - group integer declarations in snd_pcm_anonymous_dup()
> - replaced substream->pcm with pcm in snd_pcm_anonymous_dup()
> - added SNDRV_PCM_PERM_RW check for read/write/readv/writev syscalls
>
> v4 of the patches:
>
> - more simple restriction control (only two modes - full/buffer)
> - the tinyalsa implementation follows this change
>
> v5 of the patches:
>
> - merge pcm_..._mmap_allowed fcns to the snd_pcm_mmap_... fcns
>
> v6:
>
> - add proper open_mutex protection for snd_pcm_open_file()
>
> Cc: Phil Burk <philburk@google.com>
> Cc: Zach Riggle <riggle@google.com>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Leo Yan <leo.yan@linaro.org>
> Cc: Baolin Wang <baolin.wang@linaro.org>
>
> Jaroslav Kysela (3):
> ALSA: pcm: implement the anonymous dup (inode file descriptor)
> ALSA: pcm: merge pcm_..._mmap_allowed fcns to the snd_pcm_mmap_...
> fcns
> ALSA: pcm: implement the mmap buffer mode for the anonymous dup
>
> include/sound/pcm.h | 10 +--
> include/uapi/sound/asound.h | 6 +-
> sound/core/oss/pcm_oss.c | 2 +-
> sound/core/pcm.c | 13 ++--
> sound/core/pcm_compat.c | 1 +
> sound/core/pcm_native.c | 154 +++++++++++++++++++++++++++++++++-----------
> 6 files changed, 133 insertions(+), 53 deletions(-)
>
> --
> 2.13.6
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-02-08 16:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-05 18:24 [PATCH v6 0/3] ALSA: pcm: anonymous dup implementation Ricardo Biehl Pasquali
-- strict thread matches above, loose matches on Subject: below --
2019-02-04 18:38 Jaroslav Kysela
2019-02-07 16:29 ` Mark Brown
2019-02-08 16:14 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox