mirror of
https://github.com/joleuger/vuinputd.git
synced 2026-11-05 01:17:20 +00:00
[GH-ISSUE #4] [FEATURE] Implement --capability-policy for security filtering #5
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
joleuger/vuinputd#5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @joleuger on GitHub (Jan 3, 2026).
Original GitHub issue: https://github.com/joleuger/vuinputd/issues/4
Context
As discussed in ValveSoftware/steam-devices#71, exposing raw access to
/dev/uinputinside a container can be a security risk ("BadUSB" attacks, VT switching, etc.).We need a way to restrict what kind of devices a container is allowed to create.
Proposed Solution
Add a command line argument
--capability-policy(or--limit) tovuinputdthat enforces specific profiles during theUI_DEV_CREATEandUI_SET_*BITphases.Proposed Policies
1.
gamepad-only(Strict Mode)UI_SET_EVBITif it includesEV_KEYranges outside of standard Gamepad buttons (BTN_SOUTH,BTN_START, etc.).KEY_A,KEY_1, etc.).EV_ABS(Analog sticks).2.
sanitized(Safe Desktop Mode)EV_KEYranges.KEY_SYSRQ(Magic SysRq),KEY_POWER,KEY_SLEEP.write()handler, drop dangerous combinations like:Alt+F1-F12(VT Switching)Ctrl+Alt+Del3.
unrestricted(Default)Implementation Details
This should likely be checked in the
ioctlhandler forUI_SET_KEYBIT. If a client tries to enable a forbidden bit for the active policy, we should either return-EPERMor silently ignore the bit setting.