commit | a54dc52d7a051836aa2fc2e58dc766f6a263df56 | [log] [tgz] |
---|---|---|
author | Abhishek Revadekar <abhishek.rvdkr@yahoo.com> | Mon Jul 08 13:40:51 2024 -0400 |
committer | Jerome Forissier <jerome.forissier@linaro.org> | Tue Jul 23 10:20:06 2024 +0200 |
tree | 7cdee78d52c59d3dcaf45c62513ba2d3a55797ad | |
parent | 41247603db351e834e87a8c979e265016ab57300 [diff] |
core: lib: fix undefined behavior shift_out_of_bounds in libtomcrypt Replace 'i64' with 'u64' data type for variables requiring bitwise shift operations. xtest error log - 4007_ed25519: --- $ xtest 4007_ed25519 E/TC:? 0 Undefined behavior shift_out_of_bounds at core/lib/libtomcrypt/src/pk/ec25519/tweetnacl.c:55 col 12 E/TC:0 0 Panic at core/kernel/ubsan.c:193 <__ubsan_handle_shift_out_of_bounds> E/TC:0 0 TEE load address @ 0x8e100000 E/TC:0 0 Call stack: E/TC:0 0 0x8e10d6c0 print_kernel_stack at optee_os/core/arch/arm/kernel/unwind_arm64.c:89 E/TC:0 0 0x8e130c7c __do_panic at optee_os/core/kernel/panic.c:73 E/TC:0 0 0x8e134c9c __ubsan_handle_shift_out_of_bounds at optee_os/core/kernel/ubsan.c:193 E/TC:0 0 0x8e1cc740 car25519 at optee_os/core/lib/libtomcrypt/src/pk/ec25519/tweetnacl.c:55 (discriminator 1) E/TC:0 0 0x8e1cccbc M at optee_os/core/lib/libtomcrypt/src/pk/ec25519/tweetnacl.c:135 E/TC:0 0 0x8e1cced8 add at optee_os/core/lib/libtomcrypt/src/pk/ec25519/tweetnacl.c:261 E/TC:0 0 0x8e1ce594 scalarmult at optee_os/core/lib/libtomcrypt/src/pk/ec25519/tweetnacl.c:294 E/TC:0 0 0x8e1ce6ac scalarbase at optee_os/core/lib/libtomcrypt/src/pk/ec25519/tweetnacl.c:307 E/TC:0 0 0x8e1cf184 tweetnacl_crypto_sk_to_pk at optee_os/core/lib/libtomcrypt/src/pk/ec25519/tweetnacl.c:317 E/TC:0 0 0x8e1c063c ed25519_make_key at optee_os/core/lib/libtomcrypt/src/pk/ed25519/ed25519_make_key.c:25 (discriminator 2) E/TC:0 0 0x8e1bfef8 crypto_acipher_gen_ed25519_key at optee_os/core/lib/libtomcrypt/ed25519.c:64 E/TC:0 0 0x8e16b228 tee_svc_obj_generate_key_ed25519 at optee_os/core/tee/tee_svc_cryp.c:2312 E/TC:0 0 0x8e108110 scall_do_call at optee_os/core/arch/arm/kernel/arch_scall_a64.S:140 E/TC:0 0 0x8e107544 thread_scall_handler at optee_os/core/arch/arm/kernel/thread.c:1138 E/TC:0 0 0x8e1048b4 el0_svc at optee_os/core/arch/arm/kernel/thread_a64.S:850 --- Signed-off-by: Abhishek Revadekar <abhishek.rvdkr@yahoo.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
This git contains source code for the secure side implementation of OP-TEE project.
All official OP-TEE documentation has moved to http://optee.readthedocs.io.
// OP-TEE core maintainers