Summary
Server crashes with SIGSEGV when receiving MemFd-type buffers through the PipeWire portal ScreenCast capture path. The crash occurs because PipeWire's MAP_BUFFERS auto-mapping can produce stale pointers for MemFd buffers received via portal FD connections.
Affected versions
v1.4.2 and earlier (when using portal ScreenCast capture path)
Who is affected
Users on compositors where the portal backend provides MemFd buffers rather than DmaBuf. This is most commonly observed with XDPH (Hyprland's XDG Desktop Portal backend) on PipeWire 1.6.x, since XDPH defaults to MemFd unless the client advertises DmaBuf modifier support.
Affected configuration:
- Capture path: portal ScreenCast → PipeWire (not wlr-screencopy)
- Buffer type: MemFd (PipeWire
SPA_DATA_MemFd, type 2)
- Trigger: stream lifecycle event (disconnect, renegotiation) that invalidates auto-mapped pointers
NOT affected:
- Users on the wlr-screencopy capture path (bypasses PipeWire entirely)
- Users receiving DmaBuf buffers (type 3) — these already use manual mmap
- Users receiving MemPtr buffers (type 1) — direct pointer, no mapping involved
Root cause
PipeWire's MAP_BUFFERS stream flag auto-mmaps MemFd buffers at stream setup time. When the portal FD connection experiences lifecycle events (disconnect, renegotiation), the internal clear_buffers() calls munmap() but the buffer's data pointer field is not nulled. The libspa data() accessor only checks for null — it returns this stale, unmapped pointer as valid. Attempting to memcpy from it triggers SIGSEGV.
Status
Fixed in lamco-pipewire 0.3.2. Pending next server release.
Summary
Server crashes with SIGSEGV when receiving MemFd-type buffers through the PipeWire portal ScreenCast capture path. The crash occurs because PipeWire's
MAP_BUFFERSauto-mapping can produce stale pointers for MemFd buffers received via portal FD connections.Affected versions
v1.4.2 and earlier (when using portal ScreenCast capture path)
Who is affected
Users on compositors where the portal backend provides MemFd buffers rather than DmaBuf. This is most commonly observed with XDPH (Hyprland's XDG Desktop Portal backend) on PipeWire 1.6.x, since XDPH defaults to MemFd unless the client advertises DmaBuf modifier support.
Affected configuration:
SPA_DATA_MemFd, type 2)NOT affected:
Root cause
PipeWire's
MAP_BUFFERSstream flag auto-mmaps MemFd buffers at stream setup time. When the portal FD connection experiences lifecycle events (disconnect, renegotiation), the internalclear_buffers()callsmunmap()but the buffer'sdatapointer field is not nulled. The libspadata()accessor only checks for null — it returns this stale, unmapped pointer as valid. Attempting tomemcpyfrom it triggers SIGSEGV.Status
Fixed in lamco-pipewire 0.3.2. Pending next server release.