Closed SangsubLim closed 1 year ago
Clients using libteec operate in Linux user space so the normal Linux user space based address sanitizer is expected to work without any OP-TEE specific changes.
However, TAs operates in a completely different environment so compiled Linux user space libraries can't be expected to work. In this case, I'm not sure if you even can re-use any of the libasan source code.
I would like to apply Address Sanitizer to CA and TA by referring to the link below.
Looking at config.mk of optee_os and the link below, it seems that sanitizer can be applied to optee-os(CFG_CORE_SANITIZE_KADDRESS).
As I said before, I plan to apply Sanitizer to CA and TA as well. For this, I used hello world in optee_example on QEMU v8.
First, I tried CA, and modified it as follows.
Makefile
After confirming that it was built normally, I intentionally caused an error by modifying the main.c file as follows.
main.c
As a result of the test, it was confirmed that the error occurred as follows.
One curious thing is, optee_example_hello_world binary size has increased significantly. (14088->9785104) I think it increased as libasan was statically included in the CA binary, is that correct?
Anyway, although it is in the title, the problem I am currently experiencing is that AddressSanitizer cannot be applied on the TA. First of all, I looked at the link below and tried to add libasan to TA.
sub.mk
Makefile
After modifying as above, the following error occurs when TA is built.
https://github.com/OP-TEE/optee_os/issues/901 I checked the above link, but I don't know what to do.
If anyone knows anything about this, please reply. thank you