David Henningsson | 16 Jun 16:12 2011

[PATCH] udev: Allow ALSA input jacks to be accessed by the current user

One missing piece for userspace (PulseAudio etc) to actually be able to 
use the jack input devices that ALSA create, is that these devices are 
accessible by root only. This patch makes the input device nodes 
accessible by the same users that can access the sound card: the current 
logged in user, as well as users in the audio group.

One thing I was thinking about, was that the udev-acl rule actually 
grants read-write access to the input device node, where probably only 
read access is needed. Is this dangerous?

--

-- 
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
Kay Sievers | 16 Jun 16:28 2011

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

On Thu, Jun 16, 2011 at 16:12, David Henningsson
<david.henningsson <at> canonical.com> wrote:
> One missing piece for userspace (PulseAudio etc) to actually be able to use
> the jack input devices that ALSA create, is that these devices are
> accessible by root only. This patch makes the input device nodes accessible
> by the same users that can access the sound card: the current logged in
> user, as well as users in the audio group.
>
> One thing I was thinking about, was that the udev-acl rule actually grants
> read-write access to the input device node, where probably only read access
> is needed. Is this dangerous?

Takashi, wasn't there already something else to use from ALSA than the
artificial input devices?

Thanks,
Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Takashi Iwai | 16 Jun 16:48 2011
Picon

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

At Thu, 16 Jun 2011 16:28:08 +0200,
Kay Sievers wrote:
> 
> On Thu, Jun 16, 2011 at 16:12, David Henningsson
> <david.henningsson <at> canonical.com> wrote:
> > One missing piece for userspace (PulseAudio etc) to actually be able to use
> > the jack input devices that ALSA create, is that these devices are
> > accessible by root only. This patch makes the input device nodes accessible
> > by the same users that can access the sound card: the current logged in
> > user, as well as users in the audio group.
> >
> > One thing I was thinking about, was that the udev-acl rule actually grants
> > read-write access to the input device node, where probably only read access
> > is needed. Is this dangerous?
> 
> Takashi, wasn't there already something else to use from ALSA than the
> artificial input devices?

These input devices are just notification from the sound driver at
jack plugging, so basically it's read-only indeed, and setting the
file permission RO would make sense.

I can't judge more since I haven't seen the patch.

thanks,

Takashi
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo <at> vger.kernel.org
(Continue reading)

Kay Sievers | 16 Jun 16:55 2011

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

On Thu, Jun 16, 2011 at 16:48, Takashi Iwai <tiwai <at> suse.de> wrote:
> At Thu, 16 Jun 2011 16:28:08 +0200,
> Kay Sievers wrote:
>>
>> On Thu, Jun 16, 2011 at 16:12, David Henningsson
>> <david.henningsson <at> canonical.com> wrote:
>> > One missing piece for userspace (PulseAudio etc) to actually be able to use
>> > the jack input devices that ALSA create, is that these devices are
>> > accessible by root only. This patch makes the input device nodes accessible
>> > by the same users that can access the sound card: the current logged in
>> > user, as well as users in the audio group.
>> >
>> > One thing I was thinking about, was that the udev-acl rule actually grants
>> > read-write access to the input device node, where probably only read access
>> > is needed. Is this dangerous?
>>
>> Takashi, wasn't there already something else to use from ALSA than the
>> artificial input devices?
>
> These input devices are just notification from the sound driver at
> jack plugging, so basically it's read-only indeed, and setting the
> file permission RO would make sense.

Na, I mean, I remember you talking about some other channel of
notifications about jack changes.

Didn't the input devices get replaced by something on the control
device? Or was that just a plan?

Kay
(Continue reading)

Takashi Iwai | 16 Jun 17:02 2011
Picon

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

At Thu, 16 Jun 2011 16:55:39 +0200,
Kay Sievers wrote:
> 
> On Thu, Jun 16, 2011 at 16:48, Takashi Iwai <tiwai <at> suse.de> wrote:
> > At Thu, 16 Jun 2011 16:28:08 +0200,
> > Kay Sievers wrote:
> >>
> >> On Thu, Jun 16, 2011 at 16:12, David Henningsson
> >> <david.henningsson <at> canonical.com> wrote:
> >> > One missing piece for userspace (PulseAudio etc) to actually be able to use
> >> > the jack input devices that ALSA create, is that these devices are
> >> > accessible by root only. This patch makes the input device nodes accessible
> >> > by the same users that can access the sound card: the current logged in
> >> > user, as well as users in the audio group.
> >> >
> >> > One thing I was thinking about, was that the udev-acl rule actually grants
> >> > read-write access to the input device node, where probably only read access
> >> > is needed. Is this dangerous?
> >>
> >> Takashi, wasn't there already something else to use from ALSA than the
> >> artificial input devices?
> >
> > These input devices are just notification from the sound driver at
> > jack plugging, so basically it's read-only indeed, and setting the
> > file permission RO would make sense.
> 
> Na, I mean, I remember you talking about some other channel of
> notifications about jack changes.

Ah, yeah, it's still possible to implement via ALSA control API, too.
(Continue reading)

David Henningsson | 17 Jun 13:27 2011

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

On 2011-06-16 17:02, Takashi Iwai wrote:
> At Thu, 16 Jun 2011 16:55:39 +0200,
> Kay Sievers wrote:
>>
>> On Thu, Jun 16, 2011 at 16:48, Takashi Iwai<tiwai <at> suse.de>  wrote:
>>> At Thu, 16 Jun 2011 16:28:08 +0200,
>>> Kay Sievers wrote:
>>>>
>>>> On Thu, Jun 16, 2011 at 16:12, David Henningsson
>>>> <david.henningsson <at> canonical.com>  wrote:
>>>>> One missing piece for userspace (PulseAudio etc) to actually be able to use
>>>>> the jack input devices that ALSA create, is that these devices are
>>>>> accessible by root only. This patch makes the input device nodes accessible
>>>>> by the same users that can access the sound card: the current logged in
>>>>> user, as well as users in the audio group.
>>>>>
>>>>> One thing I was thinking about, was that the udev-acl rule actually grants
>>>>> read-write access to the input device node, where probably only read access
>>>>> is needed. Is this dangerous?
>>>>
>>>> Takashi, wasn't there already something else to use from ALSA than the
>>>> artificial input devices?
>>>
>>> These input devices are just notification from the sound driver at
>>> jack plugging, so basically it's read-only indeed, and setting the
>>> file permission RO would make sense.

So the problem is that there is no way to accomplish that in 
70-acl.rules right now. Would it be some kind of security flaw if we 
allowed write access? What can you really do/damage by writing to these 
(Continue reading)

Lennart Poettering | 17 Jun 14:31 2011
Picon

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

On Fri, 17.06.11 13:27, David Henningsson (david.henningsson <at> canonical.com) wrote:

> On 2011-06-16 17:02, Takashi Iwai wrote:
> >At Thu, 16 Jun 2011 16:55:39 +0200,
> >Kay Sievers wrote:
> >>
> >>On Thu, Jun 16, 2011 at 16:48, Takashi Iwai<tiwai <at> suse.de>  wrote:
> >>>At Thu, 16 Jun 2011 16:28:08 +0200,
> >>>Kay Sievers wrote:
> >>>>
> >>>>On Thu, Jun 16, 2011 at 16:12, David Henningsson
> >>>><david.henningsson <at> canonical.com>  wrote:
> >>>>>One missing piece for userspace (PulseAudio etc) to actually be able to use
> >>>>>the jack input devices that ALSA create, is that these devices are
> >>>>>accessible by root only. This patch makes the input device nodes accessible
> >>>>>by the same users that can access the sound card: the current logged in
> >>>>>user, as well as users in the audio group.
> >>>>>
> >>>>>One thing I was thinking about, was that the udev-acl rule actually grants
> >>>>>read-write access to the input device node, where probably only read access
> >>>>>is needed. Is this dangerous?
> >>>>
> >>>>Takashi, wasn't there already something else to use from ALSA than the
> >>>>artificial input devices?
> >>>
> >>>These input devices are just notification from the sound driver at
> >>>jack plugging, so basically it's read-only indeed, and setting the
> >>>file permission RO would make sense.
> 
> So the problem is that there is no way to accomplish that in
(Continue reading)

Takashi Iwai | 17 Jun 14:42 2011
Picon

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

At Fri, 17 Jun 2011 14:31:48 +0200,
Lennart Poettering wrote:
> 
> On Fri, 17.06.11 13:27, David Henningsson (david.henningsson <at> canonical.com) wrote:
> 
> > On 2011-06-16 17:02, Takashi Iwai wrote:
> > >At Thu, 16 Jun 2011 16:55:39 +0200,
> > >Kay Sievers wrote:
> > >>
> > >>On Thu, Jun 16, 2011 at 16:48, Takashi Iwai<tiwai <at> suse.de>  wrote:
> > >>>At Thu, 16 Jun 2011 16:28:08 +0200,
> > >>>Kay Sievers wrote:
> > >>>>
> > >>>>On Thu, Jun 16, 2011 at 16:12, David Henningsson
> > >>>><david.henningsson <at> canonical.com>  wrote:
> > >>>>>One missing piece for userspace (PulseAudio etc) to actually be able to use
> > >>>>>the jack input devices that ALSA create, is that these devices are
> > >>>>>accessible by root only. This patch makes the input device nodes accessible
> > >>>>>by the same users that can access the sound card: the current logged in
> > >>>>>user, as well as users in the audio group.
> > >>>>>
> > >>>>>One thing I was thinking about, was that the udev-acl rule actually grants
> > >>>>>read-write access to the input device node, where probably only read access
> > >>>>>is needed. Is this dangerous?
> > >>>>
> > >>>>Takashi, wasn't there already something else to use from ALSA than the
> > >>>>artificial input devices?
> > >>>
> > >>>These input devices are just notification from the sound driver at
> > >>>jack plugging, so basically it's read-only indeed, and setting the
(Continue reading)

Lennart Poettering | 17 Jun 14:45 2011
Picon

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

On Fri, 17.06.11 14:42, Takashi Iwai (tiwai <at> suse.de) wrote:

> > If you have the patches ready to convert all drivers which currently can
> > do jack sensing over to the new scheme with control elements, then we
> > should probably focus on that for the future, shouldn't we?
> 
> For PA work, I suppose so (although I won't object to someone working
> on the implementation with the present input-jack layer :)
> But you can see David's patch basically independent from PA.

Well, but I'd guess that the access permissions only really matter for
PA, right? So if we say that proper jack sensing via control elements is
the way to go, then PA should adopt this new scheme and this new scheme
only, and not bother with the input device cruft, and the udev patch
should not be merged either as PA would be its only consumer...

Lennart

--

-- 
Lennart Poettering - Red Hat, Inc.
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Takashi Iwai | 17 Jun 14:51 2011
Picon

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

At Fri, 17 Jun 2011 14:45:52 +0200,
Lennart Poettering wrote:
> 
> On Fri, 17.06.11 14:42, Takashi Iwai (tiwai <at> suse.de) wrote:
> 
> > > If you have the patches ready to convert all drivers which currently can
> > > do jack sensing over to the new scheme with control elements, then we
> > > should probably focus on that for the future, shouldn't we?
> > 
> > For PA work, I suppose so (although I won't object to someone working
> > on the implementation with the present input-jack layer :)
> > But you can see David's patch basically independent from PA.
> 
> Well, but I'd guess that the access permissions only really matter for
> PA, right?

Not really.  For example, I was asked about the input-jack stuff by
a couple of vendors for their own products, apparently running without
PA.

> So if we say that proper jack sensing via control elements is
> the way to go, then PA should adopt this new scheme and this new scheme
> only, and not bother with the input device cruft, and the udev patch
> should not be merged either as PA would be its only consumer...

I would be against the patch if the change were too intrusive,
but this change itself looks small enough to me.
The question whether PA should use it or not is a different thing.

thanks,
(Continue reading)

Lennart Poettering | 17 Jun 15:00 2011
Picon

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

On Fri, 17.06.11 14:51, Takashi Iwai (tiwai <at> suse.de) wrote:

> 
> At Fri, 17 Jun 2011 14:45:52 +0200,
> Lennart Poettering wrote:
> > 
> > On Fri, 17.06.11 14:42, Takashi Iwai (tiwai <at> suse.de) wrote:
> > 
> > > > If you have the patches ready to convert all drivers which currently can
> > > > do jack sensing over to the new scheme with control elements, then we
> > > > should probably focus on that for the future, shouldn't we?
> > > 
> > > For PA work, I suppose so (although I won't object to someone working
> > > on the implementation with the present input-jack layer :)
> > > But you can see David's patch basically independent from PA.
> > 
> > Well, but I'd guess that the access permissions only really matter for
> > PA, right?
> 
> Not really.  For example, I was asked about the input-jack stuff by
> a couple of vendors for their own products, apparently running without
> PA.

Well, but the point I am trying to make: the embedded vendors are not
interested in the automatic udev ACL management for the jack sensing
input devices, right?

That means the udev patch is really and only relevant for usage in PA on
desktops.

(Continue reading)

Takashi Iwai | 17 Jun 15:10 2011
Picon

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

At Fri, 17 Jun 2011 15:00:58 +0200,
Lennart Poettering wrote:
> 
> On Fri, 17.06.11 14:51, Takashi Iwai (tiwai <at> suse.de) wrote:
> 
> > 
> > At Fri, 17 Jun 2011 14:45:52 +0200,
> > Lennart Poettering wrote:
> > > 
> > > On Fri, 17.06.11 14:42, Takashi Iwai (tiwai <at> suse.de) wrote:
> > > 
> > > > > If you have the patches ready to convert all drivers which currently can
> > > > > do jack sensing over to the new scheme with control elements, then we
> > > > > should probably focus on that for the future, shouldn't we?
> > > > 
> > > > For PA work, I suppose so (although I won't object to someone working
> > > > on the implementation with the present input-jack layer :)
> > > > But you can see David's patch basically independent from PA.
> > > 
> > > Well, but I'd guess that the access permissions only really matter for
> > > PA, right?
> > 
> > Not really.  For example, I was asked about the input-jack stuff by
> > a couple of vendors for their own products, apparently running without
> > PA.
> 
> Well, but the point I am trying to make: the embedded vendors are not
> interested in the automatic udev ACL management for the jack sensing
> input devices, right?

(Continue reading)

Kay Sievers | 17 Jun 15:05 2011

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

On Fri, Jun 17, 2011 at 14:51, Takashi Iwai <tiwai <at> suse.de> wrote:
> At Fri, 17 Jun 2011 14:45:52 +0200,
> Lennart Poettering wrote:
>>
>> On Fri, 17.06.11 14:42, Takashi Iwai (tiwai <at> suse.de) wrote:
>>
>> > > If you have the patches ready to convert all drivers which currently can
>> > > do jack sensing over to the new scheme with control elements, then we
>> > > should probably focus on that for the future, shouldn't we?
>> >
>> > For PA work, I suppose so (although I won't object to someone working
>> > on the implementation with the present input-jack layer :)
>> > But you can see David's patch basically independent from PA.
>>
>> Well, but I'd guess that the access permissions only really matter for
>> PA, right?
>
> Not really.  For example, I was asked about the input-jack stuff by
> a couple of vendors for their own products, apparently running without
> PA.

I can't imagine they asked for it because they wanted input devces. I
guess they just asked for jack-events, didn't they?

>> So if we say that proper jack sensing via control elements is
>> the way to go, then PA should adopt this new scheme and this new scheme
>> only, and not bother with the input device cruft, and the udev patch
>> should not be merged either as PA would be its only consumer...
>
> I would be against the patch if the change were too intrusive,
(Continue reading)

Takashi Iwai | 17 Jun 15:15 2011
Picon

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

At Fri, 17 Jun 2011 15:05:14 +0200,
Kay Sievers wrote:
> 
> On Fri, Jun 17, 2011 at 14:51, Takashi Iwai <tiwai <at> suse.de> wrote:
> > At Fri, 17 Jun 2011 14:45:52 +0200,
> > Lennart Poettering wrote:
> >>
> >> On Fri, 17.06.11 14:42, Takashi Iwai (tiwai <at> suse.de) wrote:
> >>
> >> > > If you have the patches ready to convert all drivers which currently can
> >> > > do jack sensing over to the new scheme with control elements, then we
> >> > > should probably focus on that for the future, shouldn't we?
> >> >
> >> > For PA work, I suppose so (although I won't object to someone working
> >> > on the implementation with the present input-jack layer :)
> >> > But you can see David's patch basically independent from PA.
> >>
> >> Well, but I'd guess that the access permissions only really matter for
> >> PA, right?
> >
> > Not really.  For example, I was asked about the input-jack stuff by
> > a couple of vendors for their own products, apparently running without
> > PA.
> 
> I can't imagine they asked for it because they wanted input devces. I
> guess they just asked for jack-events, didn't they?

Right.  And the only handy and existing solutions were to use these
input devices.

(Continue reading)

Kay Sievers | 17 Jun 15:25 2011

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

On Fri, Jun 17, 2011 at 15:15, Takashi Iwai <tiwai <at> suse.de> wrote:
> At Fri, 17 Jun 2011 15:05:14 +0200, Kay Sievers wrote:
>> So if you can get the control events working in a reasonable time
>> frame, I would really prefer to add support for that to PA, and
>> nothing is needed on udev's side.
>
> OK, it's your call.

Oh, I think it's actually yours. :)

If you can provide us with the (I think much nicer) ALSA control
events, I would wait for that.

But if you tell us that we can expect that anytime soon, we will
probably need to merge the PA and udev bits (which I think is
sub-optimal).

Thanks,
Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

David Henningsson | 17 Jun 08:17 2011

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

On 2011-06-16 16:48, Takashi Iwai wrote:
> At Thu, 16 Jun 2011 16:28:08 +0200,
> Kay Sievers wrote:
>>
>> On Thu, Jun 16, 2011 at 16:12, David Henningsson
>> <david.henningsson <at> canonical.com>  wrote:
>>> One missing piece for userspace (PulseAudio etc) to actually be able to use
>>> the jack input devices that ALSA create, is that these devices are
>>> accessible by root only. This patch makes the input device nodes accessible
>>> by the same users that can access the sound card: the current logged in
>>> user, as well as users in the audio group.
>>>
>>> One thing I was thinking about, was that the udev-acl rule actually grants
>>> read-write access to the input device node, where probably only read access
>>> is needed. Is this dangerous?
>>
>> Takashi, wasn't there already something else to use from ALSA than the
>> artificial input devices?
>
> These input devices are just notification from the sound driver at
> jack plugging, so basically it's read-only indeed, and setting the
> file permission RO would make sense.
>
> I can't judge more since I haven't seen the patch.

It was posted to alsa-devel (for comments) two days ago, see:

http://mailman.alsa-project.org/pipermail/alsa-devel/2011-June/040916.html

and
(Continue reading)

Takashi Iwai | 17 Jun 08:20 2011
Picon

Re: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user

At Fri, 17 Jun 2011 08:17:07 +0200,
David Henningsson wrote:
> 
> On 2011-06-16 16:48, Takashi Iwai wrote:
> > At Thu, 16 Jun 2011 16:28:08 +0200,
> > Kay Sievers wrote:
> >>
> >> On Thu, Jun 16, 2011 at 16:12, David Henningsson
> >> <david.henningsson <at> canonical.com>  wrote:
> >>> One missing piece for userspace (PulseAudio etc) to actually be able to use
> >>> the jack input devices that ALSA create, is that these devices are
> >>> accessible by root only. This patch makes the input device nodes accessible
> >>> by the same users that can access the sound card: the current logged in
> >>> user, as well as users in the audio group.
> >>>
> >>> One thing I was thinking about, was that the udev-acl rule actually grants
> >>> read-write access to the input device node, where probably only read access
> >>> is needed. Is this dangerous?
> >>
> >> Takashi, wasn't there already something else to use from ALSA than the
> >> artificial input devices?
> >
> > These input devices are just notification from the sound driver at
> > jack plugging, so basically it's read-only indeed, and setting the
> > file permission RO would make sense.
> >
> > I can't judge more since I haven't seen the patch.
> 
> It was posted to alsa-devel (for comments) two days ago, see:
> 
(Continue reading)


Gmane