FS#24362 - [udev] ALSA /dev/snd/seq: permission denied

Attached to Project: Arch Linux
Opened by james morris (jwm-art) - Friday, 20 May 2011, 22:20 GMT
Last edited by Tom Gundersen (tomegun) - Saturday, 04 June 2011, 18:10 GMT
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To Tobias Powalowski (tpowa)
Thomas Bächler (brain0)
Tom Gundersen (tomegun)
Architecture x86_64
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

[testing] /dev/snd/seq is should be in the audio group but is in root group.

kernel26 2.6.39-1

lsmod|grep '^snd' | column -t
snd_ice1712 57822 3
snd_ice17xx_ak4xxx 2364 1 snd_ice1712
snd_ak4xxx_adda 8797 2 snd_ice1712,snd_ice17xx_ak4xxx
snd_cs8427 6673 1 snd_ice1712
snd_ac97_codec 110807 1 snd_ice1712
snd_pcm 71032 4 snd_ice1712,snd_ac97_codec
snd_timer 18896 1 snd_pcm
snd_page_alloc 7017 1 snd_pcm
snd_i2c 3865 2 snd_ice1712,snd_cs8427
snd_mpu401_uart 5779 1 snd_ice1712
snd_rawmidi 18826 1 snd_mpu401_uart
snd_seq_device 5100 1 snd_rawmidi
snd 55336 14 snd_ice1712,snd_ak4xxx_adda,snd_cs8427,snd_ac97_codec,snd_pcm,snd_timer,snd_i2c,snd_mpu401_uart,snd_rawmidi,snd_seq_device

ls /dev/snd -lh
drwxr-xr-x 2 root root 60 May 20 21:43 by-path
crw-rw----+ 1 root audio 116, 4 May 20 21:43 controlC0
crw-rw----+ 1 root audio 116, 3 May 20 21:43 pcmC0D0c
crw-rw----+ 1 root audio 116, 2 May 20 21:43 pcmC0D0p
crw------- 1 root root 116, 1 May 20 21:43 seq
crw-rw----+ 1 root audio 116, 33 May 20 21:43 timer


This task depends upon

Closed by  Tom Gundersen (tomegun)
Saturday, 04 June 2011, 18:10 GMT
Reason for closing:  Fixed
Additional comments about closing:  udev-171-2 in testing.
Comment by james morris (jwm-art) - Friday, 20 May 2011, 22:30 GMT
testing/udev 170-1
Comment by Tobias Powalowski (tpowa) - Saturday, 21 May 2011, 06:09 GMT
Probably due to the removement of custom arch rules, tom could you look at it?
Comment by Tom Gundersen (tomegun) - Saturday, 21 May 2011, 09:56 GMT
Will do.
Comment by Tom Gundersen (tomegun) - Saturday, 21 May 2011, 10:47 GMT
Still looking, but this is what I found so far:

/dev/snd/seq is created a bit before the other nodes in /dev/snd (one sec on my system), but I'm not sure by whom yet.

Loading snd_seq fixes the problem, and the reason it worked before is that snd_seq_oss (that you probably don't need/want) pulls in snd_seq. A workaround is to put snd_seq in your modules array.

I'll let you know when I have found out what's happening.
Comment by Tom Gundersen (tomegun) - Tuesday, 24 May 2011, 13:40 GMT
Problem solved:

The kernel creates the static /dev/snd/seq node (hence it is created a bit earlier than the other nodes that are created when the modules are inserted), and as with all kernel created nodes, ownership and permissions are root.root and 0600. Permissions are usually applied by udev when the snd_seq is loaded. However, udev should also apply permissions to the static nodes, which it does not do at the moment.

I submitted the attached patch upstream, please confirm that it works for you. I will add it to udev-170-2 once it has been applied upstream.

If anyone finds more cases like this, let me know.

Thanks for reporting!
Comment by Tom Gundersen (tomegun) - Tuesday, 24 May 2011, 13:41 GMT
And of course I forgot the attachment...
Comment by james morris (jwm-art) - Wednesday, 25 May 2011, 07:53 GMT
Hi Tom, Thanks, it works here.
James.
Comment by John Lindgren (jlindgren) - Wednesday, 25 May 2011, 15:08 GMT
Works here also.
Comment by Tom Gundersen (tomegun) - Wednesday, 25 May 2011, 15:33 GMT
@john,james: Great to hear! I'll include it in 170-2.

Thanks for testing!

-t
Comment by Tom Gundersen (tomegun) - Friday, 27 May 2011, 11:45 GMT
A fix was just committed upstream, and it will be included in udev-171 which will be in testing shortly. Please reopen if problem persists.
Comment by james morris (jwm-art) - Sunday, 29 May 2011, 23:09 GMT
Wrong permissions!

drwxr-xr-x 2 root root 60 May 29 09:30 by-path
crw-rw----+ 1 root audio 116, 4 May 29 09:30 controlC0
crw-rw----+ 1 root audio 116, 3 May 29 09:30 pcmC0D0c
crw-rw----+ 1 root audio 116, 2 May 29 09:30 pcmC0D0p
crw------- 1 root audio 116, 1 May 29 09:30 seq
crw-rw----+ 1 root audio 116, 33 May 29 09:30 timer
Comment by Tom Gundersen (tomegun) - Sunday, 29 May 2011, 23:15 GMT
Damn, I should have checked more carefully, Kay changed my patch before applying it and the permissions got lost. I'll resubmit.
Comment by Tom Gundersen (tomegun) - Sunday, 29 May 2011, 23:38 GMT
Actually, I think the change Kay made to my patch was correct. However, it looks like you uncovered yet another upstream bug ;-) The standard permissions on a node is 0600 if it is owned by root.root and 0660 if it is owned by a group different from root. However, it seems this logic was not applied to static nodes.

I reported it and will release a new udev with the correct patch when it appears upstream. In the meantime you could use my original rules file.

Thanks again for reporting!
Comment by Tom Gundersen (tomegun) - Monday, 30 May 2011, 12:55 GMT
Fixed upstream: <http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=c112873b5bc9ebbae39c32f502bc6211f33546cc>. I will try to make a new release relatively soon (but I'm a bit busy atm, so might be a few days, sorry for any inconvenience).
Comment by james morris (jwm-art) - Monday, 30 May 2011, 21:13 GMT
Thanks for fixing. No problem, will continue with work around until then.
Comment by Leonid Isaev (lisaev) - Tuesday, 31 May 2011, 22:12 GMT
The MODE=... statements appear to be missing in udev-171.

~> ll /dev/snd | gr -e seq -e timer
crw------- 1 root audio 116, 1 May 31 10:12 seq
crw-rw----+ 1 root audio 116, 33 May 31 10:12 timer
~> pacman -Qo /lib/udev/rules.d/50-udev-default.rules
/lib/udev/rules.d/50-udev-default.rules is owned by udev 171-1
~> sed -n '40,42p' /lib/udev/rules.d/50-udev-default.rules
# sound
SUBSYSTEM=="sound", GROUP="audio", \
OPTIONS+="static_node=snd/seq", OPTIONS+="static_node=snd/timer"
Comment by Tom Gundersen (tomegun) - Tuesday, 31 May 2011, 22:15 GMT
@lisaev: the default mode if GROUP is set is 0660. However, there was a bug, so this was not applied. This is now fixed, so in the next udev release the MODE will not be needed. See the above links for details.
Comment by Leonid Isaev (lisaev) - Tuesday, 31 May 2011, 23:15 GMT
Ahh, I got confused with the timing, thinking that 171 is the fixed release. Thank you for the explanation.

Loading...