Repository navigation
Conversation
The probe read a frame with read(), which uvcvideo does not implement, and the check always loaded vivid first, so nothing could check a real camera. The probe now lists the node's formats and takes frames by mmap streaming, the path a browser takes, in both modes. A held probe reports DQBUF-FAILED. camera-check.sh USER --hardware runs at a console of the installed laptop. It never loads vivid, and it requires a video-class USB interface with uvcvideo not loaded and no grant since boot. It also checks what only uvcvideo shows: - a program keeping its descriptor past the revoke holds the driver, which stays loaded; - a grant meanwhile is refused; - the next grant captures again and unloads the driver at its end; - deauthorizing the camera's USB device ends the grant, and the camera coming back loads nothing. The QEMU run refuses to start when a USB camera is present, and keeps its check names. Its capture check now also asks for MJPG or YUYV among the formats, and that the granted node's own driver is the expected one.
…B device, and camera.md says an infrared camera goes with it
DevomB
marked this pull request as ready for review
October 29, 2026 15:23
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the audit's camera:5.
Until now, nothing could check a real camera:
read(), which uvcvideo doesn't implement:uvc_fopshas no.read, and the capture node has only VIDEO_CAPTURE and STREAMING (v6.18.56).camera-check.shalways loaded vivid first, so a run on a laptop granted vivid's node.Probe, both modes. It lists the node's formats (VIDIOC_ENUM_FMT) and takes frames by mmap streaming: REQBUFS, QUERYBUF, mmap, QBUF, STREAMON, then select and DQBUF. That is the path a browser takes. A frame counts when
bytesusedis non-zero and the buffer isn't flagged as an error. While held, it printsDQBUF-FAILED errnoonce the node is gone. Withkeep, it then holds the descriptor two minutes more. The zone's allowlist already hasselect,mmap,dupandioctl.QEMU run (zones-test.sh, unchanged call and check names):
--hardware.camera-grantedalso checks that the granted node's own device driver is vivid.camera-zone-capturesalso asks for MJPG or YUYV among the formats (vivid offers YUYV).camera-ends-with-zone-againalso checks that uvcvideo unloaded.camera-check.sh USER --hardware, run as root at a console of the installed laptop, never loads vivid:camera-hardware: a video-class USB interface exists, uvcvideo isn't loaded, andkryptikd camera statusreads exactlynone, meaning no grant this boot.camera-other-zone-noneruns only in QEMU, since it needs a passphrase file that run makes.camera-revoked: with a program holding the node acrossk, the launcher printsuntrusted stayed, uvcvideo stays loaded, and status readsnone; its driver stayed loaded. The held descriptor's DQBUF fails.camera-kept-refuses-grant: a grant while that descriptor is held is refused with camera.rs's "still holds the camera".noneand uvcvideo unloads.camera-gone-ends-grantwrites 0 to the USB device'sauthorized. That device is found from the granted node, so a separate infrared camera can't be taken by mistake. The grant ends through udev'skryptikd camera gone, andauthorizedis written back to 1.camera-back-loads-nothing: the camera comes back, and uvcvideo isn't loaded.docs/design/camera.md(Check) anddocs/hardware.mdgain a row that runs it before anyk. That row comes after #674'scamera usblisting row, which is why this is based on zbook-batch-6.Testing on physical hardware is planned for October 2026.