[RFC] Determine Blob map_access permissions via fcntl instead of relying on defaults#42
Merged
gurchetansingh merged 2 commits intomagma-gpu:mainfrom Mar 3, 2026
Merged
Conversation
[XXX: This will be sent to Mesa] Signed-off-by: Val Packett <val@invisiblethingslab.com>
Instead of relying on defaults, use the newly available detection function for the map access mode that takes into account the fd mode and the seals. Signed-off-by: Val Packett <val@invisiblethingslab.com>
|
Hi @valpackett I've been testing muvm with X11 clients like xeyes which doesn't really exercise PipeWire SHM streaming directly. |
gurchetansingh
approved these changes
Feb 23, 2026
Collaborator
gurchetansingh
left a comment
There was a problem hiding this comment.
Looks terrific, looks ready to merge when out of RFC mode.
Collaborator
Author
|
Finally runtime-tested, and now submitted the Mesa part to Mesa: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40132 |
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.
In libkrun, we've had quite a bit of trouble with these permissions, since with the introduction of PipeWire support the mode for shm/memfd was changed to
RW, but that ended up crashing Wayland clients when the compositor would send us sealed-but-RDWR FDs (e.g. Smithay-based niri), so I've debugged that and added a check for the seals, and later discovered that wlroots-based compositors send RDONLY-but-not-write-sealed FDs and we'd still map these asRWand explode…I'm not 100% sure if
RWin this kind of mapping is necessary for PipeWire SHM streaming, interestingly #36 here does not change this (cc @dorindabassey — does PW just work withREADmappings for you?)… but once we start doing more interesting things like exporting dmabufs via PW things should definitely get more, well, interesting (I don't expect screen capture dmabufs to be writable heh). In any case relying on hardcoded defaults seems inherently limited.As the bulk of this is Mesa code, I'd like to just get initial review here, if this all seems good and correct I'll prepare a merge request for Mesa.
Also: only compile tested for now.