From ac342ff9c011938b335673ff45071d3f55b5460b Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Fri, 3 Oct 2025 16:51:56 +0200 Subject: [PATCH] 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. --- shm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shm.c b/shm.c index a222175a..29dd7672 100644 --- a/shm.c +++ b/shm.c @@ -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 */