From a23e01486c52f354874da8985c68f25b82b8b1dc Mon Sep 17 00:00:00 2001 From: Johannes Leupolz Date: Fri, 24 Oct 2025 21:46:18 +0000 Subject: [PATCH] Fix chapters in DESIGN-document --- docs/DESIGN.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 9d50a7d..9af9590 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -47,34 +47,33 @@ uinput (kernel)->>eventx: create /dev/input/eventx uinput (kernel)->>vuinputd: announce new device via udev vuinputd->>libinput/game: announce new device via udev libinput/game->>eventx: open /dev/input/eventx - ``` --- -## 2. Design Decisions +## 3. Design Decisions -### 2.1 Where `/dev/uinput` lives +### 3.1 Where `/dev/uinput` lives * **Decision**: Provide a fake `/dev/vuinput` backed by host proxy. This character device can be bind mounted inside containers to `/dev/uinput`. * **Why**: Prevents containers from creating devices visible system-wide. -### 2.2 Prevent host from using devices +### 3.2 Prevent host from using devices * **Decision**: udev rules strip `ID_INPUT_KEYBOARD` and `ID_INPUT_MOUSE`, set `ID_SEAT=seat_vuinput`. * **Why**: Ensures devices are invisible to host input subsystems while still available in containers. -### 2.3 udev events in containers +### 3.3 udev events in containers * **Decision**: Proxy forwards udev events into the container via netlink. * **Why**: Without this, SDL2 and libinput might not recognize devices correctly; with it, containers behave as if devices were created locally. -### 2.4 Where to run the proxy +### 3.4 Where to run the proxy * **Decision**: Run proxy on host, one instance per container. * **Why**: Only host can safely access `/dev/uinput` and enforce mediation. -### 2.5 Security trade-off +### 3.5 Security trade-off * **Decision**: Accept that host always sees devices, but enforce rules to stop it consuming them. * **Why**: Full input namespaces don’t exist in Linux today; mediation is the practical compromise.