mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 07:19:45 +03:00
libcamera: dma_buf_allocator: Create memfd with CLOEXEC
Ensure that the memfd file descriptor won't be leaked to child processes
by creating it with MFD_CLOEXEC.
Fixes: ea4baaacc3
("libcamera: DmaBufAllocator: Support allocating from /dev/udmabuf")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
98071d3109
commit
9c2ca46391
1 changed files with 1 additions and 1 deletions
|
@ -132,7 +132,7 @@ UniqueFD DmaBufAllocator::allocFromUDmaBuf(const char *name, std::size_t size)
|
|||
std::size_t pageMask = sysconf(_SC_PAGESIZE) - 1;
|
||||
size = (size + pageMask) & ~pageMask;
|
||||
|
||||
int ret = memfd_create(name, MFD_ALLOW_SEALING);
|
||||
int ret = memfd_create(name, MFD_ALLOW_SEALING | MFD_CLOEXEC);
|
||||
if (ret < 0) {
|
||||
ret = errno;
|
||||
LOG(DmaBufAllocator, Error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue