{"id":20201,"url":"https://patchwork.libcamera.org/api/patches/20201/?format=json","web_url":"https://patchwork.libcamera.org/patch/20201/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20240605075055.18039-1-laurent.pinchart@ideasonboard.com>","date":"2024-06-05T07:50:55","name":"libcamera: dma_buf_allocator: Create memfd with CLOEXEC","commit_ref":"9c2ca46391ea2ba089d5d082a0dbdd3b15b28498","pull_url":null,"state":"accepted","archived":false,"hash":"9e2276b21682ac5ad70bbcd4925e3634faab88c3","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/20201/mbox/","series":[{"id":4359,"url":"https://patchwork.libcamera.org/api/series/4359/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4359","date":"2024-06-05T07:50:55","name":"libcamera: dma_buf_allocator: Create memfd with CLOEXEC","version":1,"mbox":"https://patchwork.libcamera.org/series/4359/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/20201/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/20201/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 4332EBDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Jun 2024 07:51:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DD1026543E;\n\tWed,  5 Jun 2024 09:51:15 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CFE04634B5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Jun 2024 09:51:13 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6E356BEB;\n\tWed,  5 Jun 2024 09:51:05 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"cZXJvsYp\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1717573865;\n\tbh=/+cvgCiQUzbgcWnh8tv6g3xWIFQolJwST+CZL24vp00=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=cZXJvsYpU1uSsA+uJ2fTA9bHH5mzgUFG9q7g8wEuohbD7mHvoQzvuKqt9EKWx5xbI\n\t8zr1A2IQQcesnQUmlelvNe5y3JVe78jaSFBQ2VNJlL6YuQ6/gzdCoctqwEeqgpXJGv\n\tMUyDoUxUPFGWGScpLX6ndsiAPITpEjzTivpnRqXc=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Hans de Goede <hdegoede@redhat.com>","Subject":"[PATCH] libcamera: dma_buf_allocator: Create memfd with CLOEXEC","Date":"Wed,  5 Jun 2024 10:50:55 +0300","Message-ID":"<20240605075055.18039-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.44.2","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Ensure that the memfd file descriptor won't be leaked to child processes\nby creating it with MFD_CLOEXEC.\n\nFixes: ea4baaacc325 (\"libcamera: DmaBufAllocator: Support allocating from /dev/udmabuf\")\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/dma_buf_allocator.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\n\nbase-commit: 98071d3109c131820439f61d9380c0bd4cd2119a","diff":"diff --git a/src/libcamera/dma_buf_allocator.cpp b/src/libcamera/dma_buf_allocator.cpp\nindex 5ae517210adf..5ec29949c66a 100644\n--- a/src/libcamera/dma_buf_allocator.cpp\n+++ b/src/libcamera/dma_buf_allocator.cpp\n@@ -132,7 +132,7 @@ UniqueFD DmaBufAllocator::allocFromUDmaBuf(const char *name, std::size_t size)\n \tstd::size_t pageMask = sysconf(_SC_PAGESIZE) - 1;\n \tsize = (size + pageMask) & ~pageMask;\n \n-\tint ret = memfd_create(name, MFD_ALLOW_SEALING);\n+\tint ret = memfd_create(name, MFD_ALLOW_SEALING | MFD_CLOEXEC);\n \tif (ret < 0) {\n \t\tret = errno;\n \t\tLOG(DmaBufAllocator, Error)\n","prefixes":[]}