Skip to content

optee-utee: fix TEE_OperationInfoMultiple ABI and ownership - #338

Merged
ivila merged 2 commits into
apache:mainfrom
ivila:fix/operation-info-multiple-abi
Nov 10, 2026
Merged

ivila merged 2 commits into
apache:mainfrom
ivila:fix/operation-info-multiple-abi

Conversation

@ivila

@ivila ivila commented Nov 10, 2026

Copy link
Copy Markdown
Contributor
  • Fix TEE_OperationInfoMultiple to match the C flexible array member and make OperationInfoMultiple own its C-layout buffer instead of returning a dangling pointer.
  • Keep the existing info_multiple(&mut [u8]) signature and validate the buffer and reported key count before copying.

The C struct ends with a flexible array member of TEE_OperationInfoKey.
Model it as a zero-length array instead of a pointer. The pointer made
the Rust struct 40 bytes on 64-bit targets while the C sizeof is 32,
and keyInformation was treated as a pointer rather than the key data
that immediately follows the fixed header.
The old wrapper passed a zero size and a const pointer to
TEE_GetOperationInfoMultiple, so the call could not succeed and the
returned pointer could dangle. Return an owned value instead and
validate the reported key count.
@ivila ivila added the bug Something isn't working label Nov 10, 2026
@ivila
ivila merged commit fc83f9e into apache:main Nov 10, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant