home | list info | list archive | date index | thread index

[OCLUG-Tech] ubuntu 11.04, sound, /dev and ACLs -- some debugging

  • Subject: [OCLUG-Tech] ubuntu 11.04, sound, /dev and ACLs -- some debugging
  • From: "Robert P. J. Day" <rpjday [ at ] crashcourse [ dot ] ca>
  • Date: Fri, 17 Jun 2011 15:39:53 -0400 (EDT)
  just for the entertainment value, i'm going to describe something
i've been fighting with over the last several hours, since i still
haven't resolved it entirely and i'm open to suggestions.

  i recently did a release upgrade on my ubuntu laptop, upgrading it
from ubuntu 10.10 to 11.04.  at the same time, i built another
hand-rolled kernel from the git source, so that i went from a
2.6.39-rc7-dirty kernel to the current one of
3.0.0-rc3-00165-gf8f44f0-dirty.  and that's when sound on my gateway
laptop stopped working.

  if i reboot to the older kernel, sound returns.  if i boot to the
newer one, it disappears.  and after some poking around and trying to
figure out what the difference is, here's what i found.

  it seems to be described nicely here:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=593881

under the old kernel, the sound device files under /dev/snd have the
following ACL properties:

$ getfacl /dev/snd/*
# file: dev/snd/by-path
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

# file: dev/snd/controlC0
# owner: root
# group: audio
user::rw-
user:rpjday:rw-    <-- there
group::rw-
mask::rw-
other::---

# file: dev/snd/hwC0D0
# owner: root
# group: audio
user::rw-
user:rpjday:rw-
group::rw-
mask::rw-
other::---

... etc etc ...  in other words, ACLs are clearly used to give the
owner of the desktop session read/write access to all of the
sound-related /dev files, which i'm guessing is essential.

  under the new kernel, that ACL access is entirely missing:

# file: dev/snd/controlC0
# owner: root
# group: audio
user::rw-
group::rw-
other::---

# file: dev/snd/hwC0D0
# owner: root
# group: audio
user::rw-
group::rw-
other::---

# file: dev/snd/hwC0D1
# owner: root
# group: audio
user::rw-
group::rw-
other::---

... etc etc ...

which is precisely what is described at that debian bug report above.

  ok, so why is this happening?  i tried to test this by, predictably,
manually trying to add the appropriate ACL access to the /dev files,
but:

$ sudo setfacl -m u:rpjday:r /dev/snd/timer
[sudo] password for rpjday:
setfacl: /dev/snd/timer: Operation not supported
$

  huh?  why can't i do this?  oh, wait ... when a filesystem is
mounted, you need to somehow specify that that filesystem is
ACL-enabled, and on this system, the entire /dev filesystem is of type
devtmpfs:

$ mount
... snip ...
none on /dev type devtmpfs (rw,mode=0755)
... snip ...

so it's not clear to me that ACL operations are even allowed on the
contents of /dev.

  at this point, i'm not sure what to do next.  it seems clear that i
(or udev) need to "setfacl" all those /dev sound files, but i don't
see how that's possible.  and it's puzzling that this all worked fine
under the slightly older kernel, with the same version of udev.

  i'm open to suggestions.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================