[libcamera-devel] [PATCH v3 04/10] libcamera: ipa_module: verify IPA module API version upon loading
Paul Elder
paul.elder at ideasonboard.com
Wed Jun 5 02:53:10 CEST 2019
The IPA module API version determines the layout of struct
IPAModuleInfo. If this version number does not match, then it means that
the IPA module cannot be loaded at all. Validate this version number
upon loading the IPA module info from the IPA shared object.
Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
---
New patch
src/libcamera/ipa_module.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp
index f79a44e..2aa508c 100644
--- a/src/libcamera/ipa_module.cpp
+++ b/src/libcamera/ipa_module.cpp
@@ -274,6 +274,9 @@ int IPAModule::loadIPAModuleInfo()
ret = elfLoadSymbol<Elf64_Ehdr, Elf64_Shdr, Elf64_Sym>
(&info_, sizeof(info_), map, soSize, "ipaModuleInfo");
+ if (info_.moduleAPIVersion != IPA_MODULE_API_VERSION)
+ ret = -EINVAL;
+
unmap:
munmap(map, soSize);
close:
--
2.20.1
More information about the libcamera-devel
mailing list