[PATCH 08/18] optee: add support to verify 64-bit headers as well
Marco Felsch
m.felsch at pengutronix.de
Thu Jan 11 03:48:31 PST 2024
From: Rouven Czerwinski <r.czerwinski at pengutronix.de>
Guard the check by IS_ENABLED() to make it possible to verify 32-bit and
64-bit optee headers.
Signed-off-by: Rouven Czerwinski <r.czerwinski at pengutronix.de>
Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>
---
common/optee.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/common/optee.c b/common/optee.c
index 32a6c0a15b94..fd2b03d06d2d 100644
--- a/common/optee.c
+++ b/common/optee.c
@@ -14,8 +14,14 @@ int optee_verify_header(struct optee_header *hdr)
return -EINVAL;
}
- if (hdr->arch != OPTEE_ARCH_ARM32 || hdr->init_load_addr_hi) {
- pr_err("Only 32bit supported\n");
+ if (IS_ENABLED(CPU_V7) &&
+ (hdr->arch != OPTEE_ARCH_ARM32 || hdr->init_load_addr_hi)) {
+ pr_err("Wrong OP-TEE Arch for ARM v7 CPU\n");
+ return -EINVAL;
+ }
+
+ if (IS_ENABLED(CPU_V8) && hdr->arch != OPTEE_ARCH_ARM64) {
+ pr_err("Wrong OP-TEE Arch for ARM v8 CPU\n");
return -EINVAL;
}
--
2.39.2
More information about the barebox
mailing list