shm: don't grow-seal the memfd

The compositor might have to increase the size of the memfd to enable
zero-copy handling of wl_shm buffers. In particular, it might need to
increase the size to a multiple of the page size.
This commit is contained in:
Julian Orth 2025-10-03 16:51:56 +02:00
parent c462bad08c
commit ac342ff9c0

4
shm.c
View file

@ -443,10 +443,10 @@ get_new_buffers(struct buffer_chain *chain, size_t count,
}
#if defined(MEMFD_CREATE)
/* Seal file - we no longer allow any kind of resizing */
/* Seal file - we no longer allow shrinking */
/* TODO: wayland mmaps(PROT_WRITE), for some unknown reason, hence we cannot use F_SEAL_FUTURE_WRITE */
if (fcntl(pool_fd, F_ADD_SEALS,
F_SEAL_GROW | F_SEAL_SHRINK | /*F_SEAL_FUTURE_WRITE |*/ F_SEAL_SEAL) < 0)
F_SEAL_SHRINK | /*F_SEAL_FUTURE_WRITE |*/ F_SEAL_SEAL) < 0)
{
LOG_ERRNO("failed to seal SHM backing memory file");
/* This is not a fatal error */