Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#22861 - [udev] manage ACLs on /dev/input/event[0-9]

Attached to Project: Arch Linux
Opened by orbisvicis (orbisvicis) - Saturday, 12 February 2011, 00:33 GMT
Last edited by Tom Gundersen (tomegun) - Tuesday, 16 August 2011, 14:32 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tom Gundersen (tomegun)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The pulseaudio module-mmkbd-evdev requires read access to /dev/input/event* to access multimedia key presses. By default this module only attempts to access /dev/input/event0, but it can be configured to access any other evdev device.

Currently:
getfacl: Removing leading '/' from absolute path names
# file: dev/input/event0
# owner: root
# group: root
user::rw-
group::r--
other::---

It is possible to enable access by adding the line:
KERNEL=="event*", SUBSYSTEM=="input", TAG+="udev-acl"
This is vague but necessary, because at least in my case the keyboard and multimedia keys originate through the same device.

I think ubuntu might work this a bit smarter, but I don't have access to an ubuntu system atm.

Additional info:
* package version(s)
core/udev 165-1
extra/pulseaudio 0.9.22-2
This task depends upon

Closed by  Tom Gundersen (tomegun)
Tuesday, 16 August 2011, 14:32 GMT
Reason for closing:  Upstream
Comment by Gerardo Exequiel Pozzi (djgera) - Saturday, 12 February 2011, 03:27 GMT
TAG+="udev-acl" should not be used outside 70-acl.rules is "private" (see comments on that file and email from udev dev at  FS#19703 ). At least this is valid for "distros". Personally I use it in some files assuming the resposability ;)
Comment by orbisvicis (orbisvicis) - Saturday, 12 February 2011, 16:25 GMT
Have I understood this correctly:
Add to /lib/udev/rules.d/90-pulseaudio.rules:
KERNEL=="event*", SUBSYSTEM=="input", ENV{ACL_MANAGE}="1"
And add to the ACL file (70-acl.rules) before LABEL="acl_apply":
# search for user-defined ACL files
# and apply the current "udev-acl" tag
ENV{ACL_MANAGE}=="1", TAG+="udev-acl"
Comment by orbisvicis (orbisvicis) - Saturday, 12 February 2011, 16:42 GMT
Well, aside from the fact that I think 90-pulseaudio.rules would have to be executed before 70-acl.rules
Comment by orbisvicis (orbisvicis) - Thursday, 17 February 2011, 02:13 GMT
I don't think Ubuntu does anything special, I just checked. Which had me thinking - when X becomes rootless, won't all /dev/input/event* have to be ACL-managed anyway? Anyway, verdict?
Comment by Tom Gundersen (tomegun) - Monday, 11 July 2011, 10:27 GMT
I just found this report. Is this still an issue?

This is clearly something that should be decided/implemented upstream. We could backport a patch if it is accepted upstream, but I don't think we should be messing with these kind of things ourselves.
Comment by orbisvicis (orbisvicis) - Saturday, 16 July 2011, 04:36 GMT
Yes it is still an issue, but it is not critical (module-mmkbd-evdev is only a convenience)

$ pacmd
>>> load-module module-mmkbd-evdev
$ tail /var/log/errors.log:
Jul 16 00:28:56 localhost pulseaudio[3142]: module-mmkbd-evdev.c: Failed to open evdev device: Permission denied
Jul 16 00:28:56 localhost pulseaudio[3142]: module.c: Failed to load module "module-mmkbd-evdev" (argument: ""): initialization failed.

Would you mind filing the upstream bug report? I don't mind waiting till the patch hits mainstream if accepted (no need to back-port).
Comment by Tom Gundersen (tomegun) - Sunday, 17 July 2011, 22:14 GMT
As I cannot reproduce the problem, I'd rather not be the one filing the report (as upstream will likely ask more info). PulseAudio bug reports can be filed here: <https://bugs.freedesktop.org/enter_bug.cgi>.

If you post a link back to the report I'll keep an eye on it and try to help as much as I can.
Comment by orbisvicis (orbisvicis) - Saturday, 13 August 2011, 00:29 GMT
Why PulseAudio, isn't this a udev bug?
Comment by Tom Gundersen (tomegun) - Tuesday, 16 August 2011, 14:32 GMT
I spoke with some PA guys, and now the situation is clear to me:

mmkbd-evdev needs (as OP pointed out) access rights to /dev/input/event*. One way to do this would be to add these devices to the udev acl rules. If this solution is chosen it must be done in udev, as only udev is allowed to set the acl tag.

However, we cannot use ACL on the input devices in general. The kernel has no way to revoke access to open devices when the user switches, so this would open the way for keyloggers, etc.

In other words, adding ACL upstream is off the table. Probably the module should be fixed in PA to get the events in some other way.

As a workaround, there are several things that could be done:
1) add the acl TAG locally, this is a bit naughty, but if you don't tell anyone it should be ok (just be aware that it might break when udev is updated in the future).
2) add an udev rule that assign the devices to a group you are a member of.
3) depending on what you are trying to do, you might not need to use the evdev module at all. For most setups you should be able to get the same functionality via your mixer applet in your DE (assuming you are using X).

Loading...