[{"id":1771,"web_url":"https://patchwork.libcamera.org/comment/1771/","msgid":"<20190605133513.GC4784@pendragon.ideasonboard.com>","date":"2019-06-05T13:35:13","subject":"Re: [libcamera-devel] [PATCH v3 04/10] libcamera: ipa_module:\n\tverify IPA module API version upon loading","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Paul,\n\nThank you for the patch.\n\nOn Tue, Jun 04, 2019 at 08:53:10PM -0400, Paul Elder wrote:\n> The IPA module API version determines the layout of struct\n> IPAModuleInfo. If this version number does not match, then it means that\n> the IPA module cannot be loaded at all.\n\nI would say \"it means that the IPA module information structure can't be\ninterpreted, and the module can't be used.\"\n\n> Validate this version number\n> upon loading the IPA module info from the IPA shared object.\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> ---\n> New patch\n> \n>  src/libcamera/ipa_module.cpp | 3 +++\n>  1 file changed, 3 insertions(+)\n> \n> diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp\n> index f79a44e..2aa508c 100644\n> --- a/src/libcamera/ipa_module.cpp\n> +++ b/src/libcamera/ipa_module.cpp\n> @@ -274,6 +274,9 @@ int IPAModule::loadIPAModuleInfo()\n>  \t\tret = elfLoadSymbol<Elf64_Ehdr, Elf64_Shdr, Elf64_Sym>\n>  \t\t\t\t   (&info_, sizeof(info_), map, soSize, \"ipaModuleInfo\");\n>  \n> +\tif (info_.moduleAPIVersion != IPA_MODULE_API_VERSION)\n> +\t\tret = -EINVAL;\n\nPlease log a debug message, and\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +\n>  unmap:\n>  \tmunmap(map, soSize);\n>  close:","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 B698765FB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Jun 2019 15:35:31 +0200 (CEST)","from pendragon.ideasonboard.com (85-76-19-33-nat.elisa-mobile.fi\n\t[85.76.19.33])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8C38C84;\n\tWed,  5 Jun 2019 15:35:30 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1559741731;\n\tbh=eeQu8r2gYhjJGd59Xv6WGnl3+G+vp9sxxcY14ElJFJQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=uSE0r02vSLLQTvsJlcRLzZLiDexFK/upu8L9Ztn9EnMQ33BvhJPZ7clS6cmGe1jok\n\tcLfv4QGeFZivp0znUkOJkxaa1yeF/oCdsXCfZM6PI8KlK5+YwacPKJ1K5Cac3LKZKr\n\tXDuKblAI6TKN7t9OTW+MgEIHwC1MXVEUOmNKMN+0=","Date":"Wed, 5 Jun 2019 16:35:13 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190605133513.GC4784@pendragon.ideasonboard.com>","References":"<20190605005316.4835-1-paul.elder@ideasonboard.com>\n\t<20190605005316.4835-5-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190605005316.4835-5-paul.elder@ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v3 04/10] libcamera: ipa_module:\n\tverify IPA module API version upon loading","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Wed, 05 Jun 2019 13:35:32 -0000"}}]