Bug 53573 - /dev/uinput is accessible only by root
Summary: /dev/uinput is accessible only by root
Status: ASSIGNED
Alias: None
Product: Sisyphus
Classification: Development
Component: udev (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: Alexey Shabalin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-21 16:53 MSK by ildar
Modified: 2025-04-10 17:39 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ildar 2025-03-21 16:53:20 MSK
По-видимому, /dev/uinput нисколько не критичнее, чем /dev/input/*. Однако последние доступны для записи входящим в группу `input`. Но:
> $ ls -al /dev/uinput 
> crw------- 1 root root 10, 223 мар 20 14:05 /dev/uinput

Хотелось бы обеспечить доступ к устройству обычному пользователю, входящему в ту же группу input.
Comment 1 ildar 2025-04-08 15:49:58 MSK
Никаких идей?

Я, конечно, могу в пакет добавить такой udev rule, который делает, что мне нужно, но, боюсь, это будет некорректно с точки зрения общего подхода к безопасности системы.
Comment 2 Alexey Shabalin 2025-04-10 15:17:32 MSK
А что показывает?
getfacl /dev/uinput

У меня правда установлен udev-rules-logitech-unify, а в нем:
KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput"

Поэтому пользователю доступен /dev/uinput
getfacl /dev/uinput
user::rw-
user:shaba:rw-
group::---
mask::rw-
other::---
Comment 3 Alexey Shabalin 2025-04-10 15:44:31 MSK
Походий rules нашел еще тут:
https://github.com/fabiscafe/game-devices-udev/blob/main/71-uinput-dev-early-creation.rules
Может опакетить game-devices-udev?
Comment 4 ildar 2025-04-10 16:03:13 MSK
(In reply to Alexey Shabalin from comment #2)
> А что показывает?
> getfacl /dev/uinput

$  getfacl /dev/uinput
getfacl: Removing leading '/' from absolute path names
# file: dev/uinput
# owner: root
# group: root
user::rw-
group::---
other::---

(In reply to Alexey Shabalin from comment #3)
> Походий rules нашел еще тут:
> https://github.com/fabiscafe/game-devices-udev/blob/main/71-uinput-dev-early-creation.rules
> Может опакетить game-devices-udev?

Костыли насочинять я и сам могу.. Только лучше, чтобы права на устройство выдавались в одном пакете (udev), дабы избежать:
1. противоречивых правил из разных пакетов
2. проблем с безопасностью

(In reply to Alexey Shabalin from comment #2)
> У меня правда установлен udev-rules-logitech-unify, а в нем:
> KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput"

Вот именно этого хотелось бы избежать. Обрати внимание, что в этом файле написано:
# Allowing users to write to the device is potentially dangerous
# because they could perform firmware updates.
Comment 5 ildar 2025-04-10 16:04:55 MSK
(In reply to Alexey Shabalin from comment #2)
> KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput"

В общем, я не против этого правила. Даже за. Но только чтобы оно было в одном месте и для пакета `foobar` не пришлось ставить пакет `udev-rules-logitech-unify`
Comment 6 Alexey Shabalin 2025-04-10 17:39:45 MSK
Подумаю еще, куда упаковать такой rules.
Возможно проще сразу в пакет udev, что бы всем был доступен.