Commit graph

675 commits

Author SHA1 Message Date
20ee6a68e9 Bump usbip-rs to fix endpoint halt bug 2026-03-31 16:18:16 +00:00
e59ad9722c fix: strip GPU rendering resources from gpu service when only wayland is enabled
When neither gpu.opengl nor gpu.vulkan is enabled (wayland-only cross-domain),
the gpu service no longer binds /dev/dri, /dev/udmabuf, /sys/dev/char,
/sys/devices, or /run/opengl-driver. GL-related environment variables
(LD_LIBRARY_PATH, LIBGL_DRIVERS_PATH, __EGL_VENDOR_LIBRARY_DIRS,
__GL_SHADER_DISK_CACHE_PATH) are omitted, MemoryDenyWriteExecute is
enforced regardless of allowWX, and DeviceAllow is empty. DevicePolicy
is now explicitly set to "closed" in all cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 00:21:25 +00:00
efc991e2d7 fix: add sleep to vsock probe retry loop in proxy script
vsock-connect --probe returns instantly on connection refused, so the
wait loop burned through all iterations in ~2s instead of 30s. Add a
0.2s sleep between attempts so the first VM launch has time to boot.
2026-03-27 23:30:06 +00:00
72d50a50ee feat: add runtime sound control to device tray
The device tray now shows Sound Output and Microphone Input menus for
running VMs. Each direction can be toggled per-VM at runtime via the
vhost-device-sound control socket. Initial state comes from the existing
sound.playback/sound.capture NixOS options.

NixOS module passes --initial-streams and --control-socket to
vhost-device-sound. The vhost-device flake input is updated to include
the new control socket support.
2026-03-27 23:17:44 +00:00
d467ee444e Bump usbip-rs to fix device attach error 2026-03-27 19:57:56 +00:00
8cd55a5986 Update .gitignore 2026-03-27 19:43:16 +00:00
6b0cb107c9 feat: add usb.logLevel option for USB passthrough service 2026-03-27 19:42:10 +00:00
58a099f239 fix: use vmCids lookup for CID file in prep service
mkPrepServices iterates allVms (raw configs without the id field from
assignVmIds). Add a vmCids name→CID lookup map to resolve the CID.
2026-03-27 19:11:40 +00:00
ac1b2b529b Disable mesa patch, use upstream nixpkgs version 2026-03-27 18:47:57 +00:00
c1ebb1813b docs: update CLAUDE.md and README.md for vsock-connect and related changes
Document the new vmsilo-vsock library crate, vsock-connect CLI tool,
vm-stop --all flag, and CID file pattern. Update SSH ProxyCommand
description for cloud-hypervisor VMs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 18:46:41 +00:00
a545309b89 feat: add/improve bash completions for all vmsilo commands
- vm-stop: complete --all alongside running VM names
- vm-shell: show --ssh (and --root when applicable) alongside VM names
- vsock-connect: new completion with mode-aware option handling
- vm-usb: new completion for attach/detach subcommands
- Shared helpers: _vmsilo_filter_used, _vmsilo_prev_takes_value

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 18:44:24 +00:00
88d7375f38 feat: add vsock-connect to user-facing scripts
Symlinks vmsilo-vsock-connect as vsock-connect in the package bin dir.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 18:43:10 +00:00
0ea363c4bc feat: add CID file, vm-stop --all, and unify vsock scripts
- Prep service writes /run/vmsilo/<vmname>/cid for runtime autodetection
- vm-stop gains --all flag to stop all running VMs
- Proxy/USB/SSH scripts unified to use vsock-connect for both hypervisors
- dbus-proxy service uses --vmname instead of --cid/--vsock-socket

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 18:42:22 +00:00
1b826e4dd7 build: update flake.nix to include vmsilo-vsock in both Rust builds
Uses fileset.toSource to widen src for vmsilo-tools and vmsilo-dbus-proxy
so both can resolve the shared vmsilo-vsock path dependency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 18:38:55 +00:00
c613b5e0f9 refactor(dbus-proxy): use vmsilo-vsock library for vsock connections
Replaces host/vsock.rs with the shared vmsilo-vsock library crate.
Adds --vmname for autodetect mode alongside existing --cid/--vsock-socket.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 18:37:47 +00:00
f12d98fe76 feat: rename vsock-proxy to vsock-connect with async library support
Replaces the sync-only fc-vsock proxy with an async CLI supporting
both kernel vsock (crosvm) and hybrid fc-vsock (cloud-hypervisor).
Adds --timeout, --probe, and autodetect-by-vmname modes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 18:34:28 +00:00
9de2b4693c Add kde patch update script 2026-03-27 18:32:33 +00:00
e47027cf9b feat: add vmsilo-vsock library crate with async vsock connection support
Standalone Rust library for connecting to VM vsock ports. Supports both
kernel vsock (crosvm) and hybrid Unix socket with CONNECT handshake
(cloud-hypervisor). Includes autodetection via /run/vmsilo/<vmname>/,
optional timeout, and full test suite.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 18:31:05 +00:00
c24c08720a Some small kwin patch additions
Cache color lookup instead of parsing every time, plus some minor fixes.
2026-03-27 15:02:48 +00:00
b6b1f05a6a fix(dbus-proxy): add corpus/ to fuzz-afl .gitignore
Seeds are regenerable via fuzz-gen-corpus and AFL++ adds mutations
during runs — neither should be tracked.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 14:13:15 +00:00
6772a029a5 docs: update README.md fuzzing section for AFL++/SymCC and renamed apps
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 14:13:15 +00:00
890c0f5ddf docs: update CLAUDE.md fuzzing section for AFL++/SymCC and renamed apps
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 14:13:15 +00:00
9317863632 chore: update usbip-rs flake input to include AFL++/SymCC packages
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 14:13:15 +00:00
a1a732e650 feat: add AFL++/SymCC fuzzing apps, rename existing cargo-fuzz apps, add fuzz-gen-corpus
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 14:13:15 +00:00
c54b0b0ea6 feat(dbus-proxy): update generate_seeds to populate both cargo-fuzz and AFL++ corpus dirs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 14:13:15 +00:00
7343ad8ae8 feat(dbus-proxy): add AFL++ fuzz targets with Arbitrary/Unstructured for structured inputs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 14:13:15 +00:00
b01cecdc24 feat(dbus-proxy): add fuzz-afl directory structure and Cargo.toml
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 14:13:15 +00:00
7feae1eb28 Fix kwin lockup if clipboard pipe read stalls 2026-03-27 13:10:12 +00:00
92b249608a docs: add fuzz seed corpus generator usage to CLAUDE.md and README.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 00:07:37 +00:00
d0117a5526 feat(dbus-proxy): add fuzz seed corpus generator for deserialize and read_message targets
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 00:03:32 +00:00
8ea1fee141 Update .gitignore 2026-03-25 22:43:22 +00:00
3dce98cda9 docs: add fuzz-fix guidelines to CLAUDE.md (reject over log, no unsafe)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 22:32:38 +00:00
ef5e320cfc docs: add --fork and fuzz-clean-dbus-proxy usage to README and CLAUDE.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 22:24:43 +00:00
869abed1b0 fix(dbus-proxy): harden fuzz-clean-dbus-proxy against build failures and hangs
- Pre-build the target before testing artifacts; abort without deleting
  anything if the build fails
- Add 30s timeout per artifact test to prevent hangs on slow-unit inputs
- Add progress counter during artifact testing
- Add coreutils to PATH for timeout command

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 22:05:46 +00:00
db91e5e919 fix(dbus-proxy): validate pixmap data length in tint_pixmap, add fuzz-clean command
tint_pixmap crashed on index-out-of-bounds when argb_data length didn't
match width*height*4. Add checked-arithmetic validation before the loop.

Add `nix run .#fuzz-clean-dbus-proxy -- <target>` to replay all crash
artifacts and delete the ones that no longer reproduce.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:52:19 +00:00
28b1b8ae19 feat(dbus-proxy): support --fork=N in fuzz-dbus-proxy wrapper
Translates --fork=N to libfuzzer's -fork=N flag, allowing the fuzzer
to continue after finding crashes instead of stopping.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:16:10 +00:00
98cbe0164d fix(dbus-proxy): add missing desktop_entry arg to fuzz_sanitize_notification
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:10:02 +00:00
e0ab55208f feat(dbus-proxy): add cargo-fuzz fuzzing infrastructure
Add coverage-guided fuzzing for vmsilo-dbus-proxy with 5 targets:
- fuzz_deserialize: raw bytes → postcard deserialization
- fuzz_read_message: raw bytes → length-prefixed framing
- fuzz_sanitize_snapshot: structured input → sanitization invariants
- fuzz_sanitize_notification: structured input → sanitization invariants
- fuzz_tint_pixmap: structured input → pixel manipulation

Uses the arbitrary crate (behind a fuzz feature flag) for structured
input generation, with invariant assertion helpers that verify all
documented sanitization constraints.

Nix integration via rust-overlay nightly: `nix develop .#fuzz` for
interactive fuzzing, `nix run .#fuzz-dbus-proxy -- <target>` for
one-liners.

Also fixes a sanitization bug found by the fuzzer: sanitize_menu_tree
did not clamp negative IDs on the root menu node.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 21:05:28 +00:00
a918cba793 Add support for commit-timing-v1, ext-data-control-v1 and xdg-dialog-v1
Also updates a few existing protocols to newer versions, and updates the
wayland-proxy dmabuf code to use the stable protocol. The dmabuf code is
still disabled as it does not work, but can be tested with the `--dmabuf`
wayland-proxy-virtwl argument.
2026-03-25 16:31:55 +00:00
e71298b5e8 Bump usbip-rs and wayland proxy for reliability improvements 2026-03-25 15:23:04 +00:00
09000e6c8a Bump wayland proxy for reliability improvements 2026-03-25 15:12:23 +00:00
75ffcde7f6 Harden host-netvm isolation, simplify services, refactor dbus-proxy
Security: add nftables input chain to block VMs with netvm="host" from
connecting to host services (only established/related return traffic
allowed). Cap notification active_ids to 1000 entries to prevent
unbounded growth from leaked IDs.

Simplify: replace 4 writeShellScript cleanup wrappers with inline rm,
break up balloond ExecStart one-liner for readability.

Refactor dbus-proxy: extract ConnectionState struct to reduce
run_event_loop from 11 to 6 parameters, add shared pixel format module
(argb_to_rgba/rgba_to_argb) eliminating duplicate conversions in icon.rs
and notifications.rs. Run cargo fmt.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 12:09:44 +00:00
f3663e7e66 Sandbox virtiofsd services with namespace isolation and hardening
virtiofsd has built-in sandboxing (--sandbox=namespace): it creates
mount/PID/network namespaces, does pivot_root, drops capabilities, and
applies its own seccomp filter. The systemd unit adds non-overlapping
hardening: IPC/UTS namespace isolation, seccomp-based protections, a
capability bounding set as defense-in-depth, and LimitNOFILE=1048576.

Per-instance runtime directories (/run/vmsilo/<vmname>/virtiofs-<tag>/)
replace the shared directory for better isolation.

New VM options: virtiofs.seccompPolicy and virtiofs.disableSandbox.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:48:20 +00:00
5ccd64c41f Update TODO.md 2026-03-24 19:21:35 +00:00
5699c71a04 Forward desktop-entry hint for guest notification history support
Guest notifications were missing from notification history because they
lacked the desktop-entry hint. Extract the hint from guest D-Bus, sanitize
it (whitelist [a-zA-Z0-9._-]), rewrite with vmsilo.<vm>. prefix, and only
include it if a matching .desktop file exists on the host.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 19:15:16 +00:00
b2611519de Fix host USB unit sandbox device access 2026-03-24 18:55:33 +00:00
8854344976 Detect dark/light panel for tray icon color
Embed both light-on-dark and dark-on-light tray icon variants. At
startup, read the KDE icon theme from kdeglobals to determine panel
color and select the matching variant for icon_pixmap().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 18:13:27 +00:00
bef43e89a2 Use icon_pixmap for tray icon instead of icon_name theme lookup
IconThemePath was not working reliably with KDE. Switch to embedding
the tray icon as ARGB32 pixel data via icon_pixmap(), which bypasses
theme lookup entirely. Also remove Breeze theme icon installation
since all icons are now embedded in the binary.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 18:10:15 +00:00
391cce0f1c update TODO.md 2026-03-24 17:45:07 +00:00
11ae93f0b6 Fix vsock socket permissions
USB service couldn't use it because it runs as root in a user namespace,
and it was owned by cfg.user with 1777 perms.
2026-03-24 17:28:29 +00:00