<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>53573</bug_id>
          
          <creation_ts>2025-03-21 16:53:20 +0300</creation_ts>
          <short_desc>/dev/uinput is accessible only by root</short_desc>
          <delta_ts>2025-06-05 15:07:39 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>udev</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>ASSIGNED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="ildar">ildar</reporter>
          <assigned_to name="Alexey Shabalin">shaba</assigned_to>
          <cc>andy</cc>
    
    <cc>arseny</cc>
    
    <cc>shaba</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>261624</commentid>
    <comment_count>0</comment_count>
    <who name="ildar">ildar</who>
    <bug_when>2025-03-21 16:53:20 +0300</bug_when>
    <thetext>По-видимому, /dev/uinput нисколько не критичнее, чем /dev/input/*. Однако последние доступны для записи входящим в группу `input`. Но:
&gt; $ ls -al /dev/uinput 
&gt; crw------- 1 root root 10, 223 мар 20 14:05 /dev/uinput

Хотелось бы обеспечить доступ к устройству обычному пользователю, входящему в ту же группу input.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262641</commentid>
    <comment_count>1</comment_count>
    <who name="ildar">ildar</who>
    <bug_when>2025-04-08 15:49:58 +0300</bug_when>
    <thetext>Никаких идей?

Я, конечно, могу в пакет добавить такой udev rule, который делает, что мне нужно, но, боюсь, это будет некорректно с точки зрения общего подхода к безопасности системы.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262794</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Shabalin">shaba</who>
    <bug_when>2025-04-10 15:17:32 +0300</bug_when>
    <thetext>А что показывает?
getfacl /dev/uinput

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

Поэтому пользователю доступен /dev/uinput
getfacl /dev/uinput
user::rw-
user:shaba:rw-
group::---
mask::rw-
other::---</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262796</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Shabalin">shaba</who>
    <bug_when>2025-04-10 15:44:31 +0300</bug_when>
    <thetext>Походий rules нашел еще тут:
https://github.com/fabiscafe/game-devices-udev/blob/main/71-uinput-dev-early-creation.rules
Может опакетить game-devices-udev?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262798</commentid>
    <comment_count>4</comment_count>
    <who name="ildar">ildar</who>
    <bug_when>2025-04-10 16:03:13 +0300</bug_when>
    <thetext>(In reply to Alexey Shabalin from comment #2)
&gt; А что показывает?
&gt; getfacl /dev/uinput

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

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

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

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

Вот именно этого хотелось бы избежать. Обрати внимание, что в этом файле написано:
# Allowing users to write to the device is potentially dangerous
# because they could perform firmware updates.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262799</commentid>
    <comment_count>5</comment_count>
    <who name="ildar">ildar</who>
    <bug_when>2025-04-10 16:04:55 +0300</bug_when>
    <thetext>(In reply to Alexey Shabalin from comment #2)
&gt; KERNEL==&quot;uinput&quot;, SUBSYSTEM==&quot;misc&quot;, TAG+=&quot;uaccess&quot;, OPTIONS+=&quot;static_node=uinput&quot;

В общем, я не против этого правила. Даже за. Но только чтобы оно было в одном месте и для пакета `foobar` не пришлось ставить пакет `udev-rules-logitech-unify`</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262810</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Shabalin">shaba</who>
    <bug_when>2025-04-10 17:39:45 +0300</bug_when>
    <thetext>Подумаю еще, куда упаковать такой rules.
Возможно проще сразу в пакет udev, что бы всем был доступен.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>266533</commentid>
    <comment_count>7</comment_count>
    <who name="ildar">ildar</who>
    <bug_when>2025-06-05 00:29:37 +0300</bug_when>
    <thetext>ну как?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>266609</commentid>
    <comment_count>8</comment_count>
    <who name="Andrew Vasilyev">andy</who>
    <bug_when>2025-06-05 14:47:59 +0300</bug_when>
    <thetext>В /lib/udev/rules.d/60-antimicrox-uinput.rules:

SUBSYSTEM==&quot;misc&quot;, KERNEL==&quot;uinput&quot;, OPTIONS+=&quot;static_node=uinput&quot;, TAG+=&quot;uaccess&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>266616</commentid>
    <comment_count>9</comment_count>
    <who name="ildar">ildar</who>
    <bug_when>2025-06-05 15:07:39 +0300</bug_when>
    <thetext>(In reply to Andrew Vasilyev from comment #8)
&gt; В /lib/udev/rules.d/60-antimicrox-uinput.rules:
&gt; 
&gt; SUBSYSTEM==&quot;misc&quot;, KERNEL==&quot;uinput&quot;, OPTIONS+=&quot;static_node=uinput&quot;,
&gt; TAG+=&quot;uaccess&quot;

Вот, пожалуйста, ещё одно подтверждение. Я всё же предлагаю нормально сделать:

(In reply to ildar from comment #4)
&gt; ... лучше, чтобы права на устройство выдавались в одном пакете (udev), дабы избежать:
&gt; 1. противоречивых правил из разных пакетов
&gt; 2. проблем с безопасностью</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>