allocators: shm: Remove future write sealing

By sealing for future writes, we broke Wayland SHM support. It seems like the
wayland library maps the SHM in read/write mode. This is visible through no
display and an error message like this:

  wl_shm@7: error 2: failed mmap fd 43: Operation not permitted

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5684>
This commit is contained in:
Nicolas Dufresne 2023-11-16 14:39:35 -05:00 committed by GStreamer Marge Bot
parent 2afe7cb97e
commit e523dd9f08

View file

@ -151,9 +151,7 @@ gst_shm_allocator_alloc (GstAllocator * allocator, gsize size,
gst_memory_unmap (mem, &info);
#ifdef HAVE_MEMFD_CREATE
/* Now that it's kept mapped RW, seal it for any future mapping. This ensures
* that other processes receiving this memfd won't be able to modify it. */
fcntl (fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_FUTURE_WRITE);
fcntl (fd, F_ADD_SEALS, F_SEAL_SHRINK);
#endif
return mem;