ivila commented on issue #168:
URL: 
https://github.com/apache/incubator-teaclave-trustzone-sdk/issues/168#issuecomment-2795751145

   Found some bugs while trying to fix `ctest`. Includes:
   
   1. In `tee_api.rs`, `TEE_MemMove` doesn't return a value, but our definition 
does. Same as other functions like `TEE_MemFill`
       
https://github.com/apache/incubator-teaclave-trustzone-sdk/blob/4069aacc76185374d7c9bf21240064a2bbbf6102/optee-utee/optee-utee-sys/src/tee_api.rs#L114
   4. In `utee_syscall.rs`, the type of the info argument of 
`_utee_cryp_obj_get_info` should be `utee_object_info`, not `TEE_ObjectInfo`. 
Same as other functions like `_utee_storage_next_enum`.
       
https://github.com/apache/incubator-teaclave-trustzone-sdk/blob/4069aacc76185374d7c9bf21240064a2bbbf6102/optee-utee/optee-utee-sys/src/utee_syscalls.rs#L97
   6. In `tee_client_api.rs`, the type definition of `TEEC_SharedMemory` 
mismatch with 
[OP-TEE/optee_client](https://github.com/OP-TEE/optee_client/blob/02e7f9213b0d7db9c35ebf1e41e733fc9c5a3f75/libteec/include/tee_client_api.h#L314-L328).
       In `optee_client`, the flags in imp is uint32_t, while our definition is 
`a Struct with bool and u8`.
       
https://github.com/apache/incubator-teaclave-trustzone-sdk/blob/4069aacc76185374d7c9bf21240064a2bbbf6102/optee-teec/optee-teec-sys/src/tee_client_api.rs#L100-L116
       Even if we fix this issue, we'll still face another problem: a mismatch 
in field offsets starting from the `imp` fields. This happens because we 
flatten the fields in Rust, whereas in C, they are grouped into an anonymous 
struct. As a result, there's a 32-bit padding between `the uint32_t flags 
field` and `the imp anonymous struct field`.
       
![Image](https://github.com/user-attachments/assets/42ea30b7-6b1b-4e0c-81cb-13e51780999d)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@teaclave.apache.org
For additional commands, e-mail: dev-h...@teaclave.apache.org

Reply via email to