Skip to content

Conversation

@Akshay-Belsare
Copy link

Add null checks before calling TEE_FreeOperation() to prevent TA panic when __OPTEE_CORE_API_COMPAT_1_1 is enable. The __GP11_TEE_FreeOperation() wrapper calls TEE_Panic(0) when passed TEE_HANDLE_NULL. Explicit validation ensures only valid handles reach the TEE API functions.

This resolves #144

@jenswi-linaro
Copy link
Contributor

How about fixing the problem by stepping up the used API?

@amey-raghatate
Copy link
Contributor

Hi @jenswi-linaro, Could you please specify which TEE API should I use to replace the GP 1.1 compatibility mode.

@jenswi-linaro
Copy link
Contributor

Removing the CFG_TA_OPTEE_CORE_API_COMPAT_1_1=y line in each TA Makefile should be enough. If you don't mind, please fix all the TAs in this git.

@jenswi-linaro
Copy link
Contributor

Please squash these changes into one commit.

@Akshay-Belsare
Copy link
Author

Sure @jenswi-linaro.
I kept them separate to facilitate a smoother review process.
Since the CFG_TA_OPTEE_CORE_API_COMPAT_1_1 has been removed, would you like me to drop the first patch?

@jenswi-linaro
Copy link
Contributor

Yes, please. The diff looks good.

Remove CFG_TA_OPTEE_CORE_API_COMPAT_1_1=y to fix TA panic 0x0 from
null handle operations.
Change tag_len/out_len from uint32_t to size_t in auth_enc_op() to match
modern TEE API function signatures for TEE_AEEncryptFinal and
TEE_AEDecryptFinal.
Fix format specifiers from %d to %zu for size_t variables to resolve
compiler warnings.

Signed-off-by: Amey Avinash Raghatate <ameyavinash.raghatate@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AES TA panic after removing null checks from TEE_FreeOperation() calls in GP 1.1 compatibility mode

4 participants