{"id":14867,"url":"https://patchwork.libcamera.org/api/1.1/patches/14867/?format=json","web_url":"https://patchwork.libcamera.org/patch/14867/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20211130033820.18235-12-laurent.pinchart@ideasonboard.com>","date":"2021-11-30T03:38:09","name":"[libcamera-devel,v4,11/22] libcamera: ipc_unixsocket: Fix file descriptor leak","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"08a48d5705828732fa6665ce5a56b49c7a2cce59","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14867/mbox/","series":[{"id":2776,"url":"https://patchwork.libcamera.org/api/1.1/series/2776/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2776","date":"2021-11-30T03:37:58","name":"libcamera: Introduce UniqueFD","version":4,"mbox":"https://patchwork.libcamera.org/series/2776/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14867/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14867/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 D2F44C3250\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Nov 2021 03:39:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6375F605C9;\n\tTue, 30 Nov 2021 04:39:10 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5C671605C5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 04:38:53 +0100 (CET)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F15658F0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 04:38:52 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"VLzOLZC+\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638243533;\n\tbh=HRaDc/H3d+k8FtCEKM4DP3DYdnS5/MmVHIPIqXvhsnQ=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=VLzOLZC+LQ3y6DpZDamziAObYPkUC6ve4QPMM7helm+k7zXBfFzUYAn8gCGsCja7V\n\tpS6oCdT5UThELYE2R9U8DUs44bW2PVF5AZLYBnN00DIsF6bwJqle/ZkBvxQCN3rQ+T\n\tW+xvxOCH1Lx1lADVNuNo83GRzWFcWohixxToj2c0=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 30 Nov 2021 05:38:09 +0200","Message-Id":"<20211130033820.18235-12-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.32.0","In-Reply-To":"<20211130033820.18235-1-laurent.pinchart@ideasonboard.com>","References":"<20211130033820.18235-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 11/22] libcamera: ipc_unixsocket: Fix\n\tfile descriptor leak","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":"The file descriptor created for the remote side of the socket is passed\nto the forked process, but never closed. Fix the leak.\n\nThe fix can be tested by running the unixsocket_ipc unit test under\nvalgrind with `valgrind --track-fds=yes ./test/ipc/unixsocket_ipc`.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/ipc_pipe_unixsocket.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)","diff":"diff --git a/src/libcamera/ipc_pipe_unixsocket.cpp b/src/libcamera/ipc_pipe_unixsocket.cpp\nindex 65277500ff42..3ef907090131 100644\n--- a/src/libcamera/ipc_pipe_unixsocket.cpp\n+++ b/src/libcamera/ipc_pipe_unixsocket.cpp\n@@ -38,7 +38,7 @@ IPCPipeUnixSocket::IPCPipeUnixSocket(const char *ipaModulePath,\n \t}\n \tsocket_->readyRead.connect(this, &IPCPipeUnixSocket::readyRead);\n \targs.push_back(std::to_string(fd.get()));\n-\tfds.push_back(fd.release());\n+\tfds.push_back(fd.get());\n \n \tproc_ = std::make_unique<Process>();\n \tint ret = proc_->start(ipaProxyWorkerPath, args, fds);\n","prefixes":["libcamera-devel","v4","11/22"]}