Skip to content

fix(cua-driver): prevent Linux uinput pointer panics - #2736

Merged
f-trycua merged 2 commits into
mainfrom
codex/fix-2715-linux-uinput-name
Aug 4, 2026
Merged

fix(cua-driver): prevent Linux uinput pointer panics#2736
f-trycua merged 2 commits into
mainfrom
codex/fix-2715-linux-uinput-name

Conversation

@f-trycua

@f-trycua f-trycua commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • bound Linux uinput pointer names to evdev 0.12's 78-byte ceiling, preserving the generated process/nonce suffix
  • sanitize control characters and truncate multibyte UTF-8 only at character boundaries
  • contain dependency panics and device-construction errors inside the blocking worker
  • return {"code":"uinput_unavailable"} instead of unwinding the worker or silently claiming fallback success
  • keep later daemon input work usable after a contained construction panic
  • exercise the regression against a real /dev/uinput device on the hosted Linux runner

Root cause

evdev 0.12 asserts during VirtualDevice::build when the supplied name exceeds its stricter limit. The name included a caller-controlled session/cursor identifier, so an overlong identifier unwound the Tokio blocking worker before the existing fallback could run. Device creation errors were otherwise swallowed by the XSendEvent fallback, which could report success despite the real-input route being unavailable.

Validation

  • cargo fmt --package platform-linux -- --check
  • cargo test --locked -p platform-linux (16 host-runnable tests passed on macOS)
  • exact-SHA Linux unit run: passed at d9abbf641962a2e667925892cca3bded70b78ca8
  • exact-SHA Linux interactive run: source resolution, capture/desktop scope, Electron/Tauri, GTK3 native harness, install smoke, and matrix summary all passed

The real-uinput CI step loads the hosted runner's uinput module, grants access to the ephemeral device, and builds a pointer from an overlong multibyte name through the production function.

Provenance

Salvaged from #2736's original bounded-name implementation; its source commit remains preserved through cherry-pick -x. Reported and diagnosed by @marvinbaudach in #2715.

Fixes #2715.

@f-trycua
f-trycua marked this pull request as ready for review July 31, 2026 22:27
@f-trycua
f-trycua requested review from ddupont808 and injaneity July 31, 2026 22:27
trycua-release[bot] added 2 commits August 4, 2026 05:00
Convert evdev construction failures and panics into a stable structured error while keeping the daemon worker usable.

Salvaged from #2736.

Refs #2715.
@f-trycua
f-trycua marked this pull request as draft August 4, 2026 10:06
@f-trycua
f-trycua force-pushed the codex/fix-2715-linux-uinput-name branch from be6d93b to d9abbf6 Compare August 4, 2026 10:06
@f-trycua f-trycua changed the title fix(cua-driver): prevent Linux uinput name panics fix(cua-driver): prevent Linux uinput pointer panics Aug 4, 2026
@f-trycua
f-trycua marked this pull request as ready for review August 4, 2026 12:28
@f-trycua
f-trycua merged commit 9fde53e into main Aug 4, 2026
42 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cua-driver (Linux/X11): pixel click panics the worker in evdev — assertion failed: name_bytes.len() + 1 < UINPUT_MAX_NAME_SIZE

1 participant