OP-TEE / optee_test

Test suite
Other
77 stars 198 forks source link

Regression tests fail when a partition other than `rootfs` is mounted onto `/data` #517

Closed anik01ic closed 3 years ago

anik01ic commented 3 years ago

Some tests fail on an STM32 chip. The version I am working with is 3.12.0. I have increased the log level to 3 and set the CFG_UNWIND=y. Before running the tests, I have delete /data/tee. Any help is highly appreciated:

* regression_6018 Large object
o regression_6018.1 Storage id: 00000001
writing 0
writing 1
writing 2
writing 3
writing 4
writing 5
E/TC:? 0 
E/TC:? 0 TA panicked with code 0xffff0000
E/LD:  Status of TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
E/LD:   arch: arm
E/LD:  region  0: va 0x40002000 pa 0x00000000 size 0x002000 flags rw-s (ldelf)
E/LD:  region  1: va 0x40004000 pa 0x00000000 size 0x006000 flags r-xs (ldelf)
E/LD:  region  2: va 0x4000a000 pa 0x00000000 size 0x001000 flags rw-s (ldelf)
E/LD:  region  3: va 0x4000b000 pa 0x00000000 size 0x004000 flags rw-s (ldelf)
E/LD:  region  4: va 0x4000f000 pa 0x00000000 size 0x001000 flags r--s
E/LD:  region  5: va 0x40010000 pa 0x00000000 size 0x001000 flags rw-s (stack)
E/LD:  region  6: va 0x40011000 pa 0xc6d15c18 size 0x009000 flags rw-- (param)
E/LD:  region  7: va 0x40038000 pa 0x00001000 size 0x00b000 flags r-xs [0]
E/LD:  region  8: va 0x40043000 pa 0x0000c000 size 0x014000 flags rw-s [0]
E/LD:   [0] b689f2a7-8adf-477a-9f99-32e90c0ad0a2 @ 0x40038000
E/LD:  Call stack:
E/LD:   0x4003bb84
E/LD:   0x40039deb
E/LD:   0x40038219
E/LD:   0x4003c491
E/LD:   0x40040e9f
E/LD:   0x400388f4
/usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/host/xtest/regression_6000.c:1707: fs_write(&sess, obj, block, block_size) has an unexpected value: 0xffff3024 = TEE_ERROR_TARGET_DEAD, expected 0x0 = TEEC_SUCCESS
  regression_6018.1 FAILED
o regression_6018.2 Storage id: 80000000
E/TC:? 0 
E/TC:? 0 TA panicked with code 0xffff0000
E/LD:  Status of TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
E/LD:   arch: arm
E/LD:  region  0: va 0x40002000 pa 0x00000000 size 0x002000 flags rw-s (ldelf)
E/LD:  region  1: va 0x40004000 pa 0x00000000 size 0x006000 flags r-xs (ldelf)
E/LD:  region  2: va 0x4000a000 pa 0x00000000 size 0x001000 flags rw-s (ldelf)
E/LD:  region  3: va 0x4000b000 pa 0x00000000 size 0x004000 flags rw-s (ldelf)
E/LD:  region  4: va 0x4000f000 pa 0x00000000 size 0x001000 flags r--s
E/LD:  region  5: va 0x40010000 pa 0x00000000 size 0x001000 flags rw-s (stack)
E/LD:  region  6: va 0x40011000 pa 0xc820f864 size 0x001000 flags rw-- (param)
E/LD:  region  7: va 0x40078000 pa 0x00001000 size 0x00b000 flags r-xs [0]
E/LD:  region  8: va 0x40083000 pa 0x0000c000 size 0x014000 flags rw-s [0]
E/LD:   [0] b689f2a7-8adf-477a-9f99-32e90c0ad0a2 @ 0x40078000
E/LD:  Call stack:
E/LD:   0x4007bb84
E/LD:   0x40079be1
E/LD:   0x400780e7
E/LD:   0x4007c491
E/LD:   0x40080e9f
E/LD:   0x400788f4
/usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/host/xtest/regression_6000.c:1697: fs_create(&sess, file_01, sizeof(file_01), 0x00000002, 0, ((void *)0), 0, &obj, storage_id) has an unexpected value: 0xffff3024 = TEE_ERROR_TARGET_DEAD, expected 0x0 = TEEC_SUCCESS
  regression_6018.2 FAILED
  regression_6018 FAILED

* regression_6019 Storage independence
o regression_6019.1 Storage id: 00000001
E/TC:? 0 
E/TC:? 0 TA panicked with code 0xffff0000
E/LD:  Status of TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
E/LD:   arch: arm
E/LD:  region  0: va 0x40002000 pa 0x00000000 size 0x002000 flags rw-s (ldelf)
E/LD:  region  1: va 0x40004000 pa 0x00000000 size 0x006000 flags r-xs (ldelf)
E/LD:  region  2: va 0x4000a000 pa 0x00000000 size 0x001000 flags rw-s (ldelf)
E/LD:  region  3: va 0x4000b000 pa 0x00000000 size 0x004000 flags rw-s (ldelf)
E/LD:  region  4: va 0x4000f000 pa 0x00000000 size 0x001000 flags r--s
E/LD:  region  5: va 0x40010000 pa 0x00000000 size 0x001000 flags rw-s (stack)
E/LD:  region  6: va 0x40011000 pa 0xc820f868 size 0x001000 flags rw-- (param)
E/LD:  region  7: va 0x40012000 pa 0xc820f864 size 0x001000 flags rw-- (param)
E/LD:  region  8: va 0x40041000 pa 0x00001000 size 0x00b000 flags r-xs [0]
E/LD:  region  9: va 0x4004c000 pa 0x0000c000 size 0x014000 flags rw-s [0]
E/LD:   [0] b689f2a7-8adf-477a-9f99-32e90c0ad0a2 @ 0x40041000
E/LD:  Call stack:
E/LD:   0x40044b84
E/LD:   0x40042be1
E/LD:   0x400410e7
E/LD:   0x40045491
E/LD:   0x40049e9f
E/LD:   0x400418f4
/usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/host/xtest/regression_6000.c:1784: fs_create(&sess, file_01, sizeof(file_01), 0x00000002 | 0x00000004 | 0x00000400, 0, data_00, sizeof(data_00), &obj, storage_id) has an unexpected value: 0xffff3024 = TEE_ERROR_TARGET_DEAD, expected 0x0 = TEEC_SUCCESS
  regression_6019.1 FAILED
o regression_6019.2 Storage id: 80000000
E/TC:? 0 
E/TC:? 0 TA panicked with code 0xffff0000
E/LD:  Status of TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
E/LD:   arch: arm
E/LD:  region  0: va 0x40002000 pa 0x00000000 size 0x002000 flags rw-s (ldelf)
E/LD:  region  1: va 0x40004000 pa 0x00000000 size 0x006000 flags r-xs (ldelf)
E/LD:  region  2: va 0x4000a000 pa 0x00000000 size 0x001000 flags rw-s (ldelf)
E/LD:  region  3: va 0x4000b000 pa 0x00000000 size 0x004000 flags rw-s (ldelf)
E/LD:  region  4: va 0x4000f000 pa 0x00000000 size 0x001000 flags r--s
E/LD:  region  5: va 0x40010000 pa 0x00000000 size 0x001000 flags rw-s (stack)
E/LD:  region  6: va 0x40011000 pa 0xc820f868 size 0x001000 flags rw-- (param)
E/LD:  region  7: va 0x40012000 pa 0xc820f864 size 0x001000 flags rw-- (param)
E/LD:  region  8: va 0x40052000 pa 0x00001000 size 0x00b000 flags r-xs [0]
E/LD:  region  9: va 0x4005d000 pa 0x0000c000 size 0x014000 flags rw-s [0]
E/LD:   [0] b689f2a7-8adf-477a-9f99-32e90c0ad0a2 @ 0x40052000
E/LD:  Call stack:
E/LD:   0x40055b84
E/LD:   0x40053be1
E/LD:   0x400520e7
E/LD:   0x40056491
E/LD:   0x4005ae9f
E/LD:   0x400528f4
/usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/host/xtest/regression_6000.c:1784: fs_create(&sess, file_01, sizeof(file_01), 0x00000002 | 0x00000004 | 0x00000400, 0, data_00, sizeof(data_00), &obj, storage_id) has an unexpected value: 0xffff3024 = TEE_ERROR_TARGET_DEAD, expected 0x0 = TEEC_SUCCESS
  regression_6019.2 FAILED
  regression_6019 FAILED

* regression_6020 Object IDs in SHM (negative)
o regression_6020.1 Storage id: 00000001
E/TC:? 0 
E/TC:? 0 TA panicked with code 0xffff0000
E/LD:  Status of TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
E/LD:   arch: arm
E/LD:  region  0: va 0x40002000 pa 0x00000000 size 0x002000 flags rw-s (ldelf)
E/LD:  region  1: va 0x40004000 pa 0x00000000 size 0x006000 flags r-xs (ldelf)
E/LD:  region  2: va 0x4000a000 pa 0x00000000 size 0x001000 flags rw-s (ldelf)
E/LD:  region  3: va 0x4000b000 pa 0x00000000 size 0x004000 flags rw-s (ldelf)
E/LD:  region  4: va 0x4000f000 pa 0x00000000 size 0x001000 flags r--s
E/LD:  region  5: va 0x40010000 pa 0x00000000 size 0x001000 flags rw-s (stack)
E/LD:  region  6: va 0x40011000 pa 0xc820f868 size 0x001000 flags rw-- (param)
E/LD:  region  7: va 0x40012000 pa 0xc820f864 size 0x001000 flags rw-- (param)
E/LD:  region  8: va 0x40068000 pa 0x00001000 size 0x00b000 flags r-xs [0]
E/LD:  region  9: va 0x40073000 pa 0x0000c000 size 0x014000 flags rw-s [0]
E/LD:   [0] b689f2a7-8adf-477a-9f99-32e90c0ad0a2 @ 0x40068000
E/LD:  Call stack:
E/LD:   0x4006bb84
E/LD:   0x40069be1
E/LD:   0x400680e7
E/LD:   0x4006c491
E/LD:   0x40070e9f
E/LD:   0x400688f4
/usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/host/xtest/regression_6000.c:1955: res has an unexpected value: 0xffff3024 = TEE_ERROR_TARGET_DEAD, expected 0x0 = TEEC_SUCCESS
/usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/host/xtest/regression_6000.c:2053: fs_unlink(&sess, obj) has an unexpected value: 0xffff3024 = TEE_ERROR_TARGET_DEAD, expected 0x0 = TEEC_SUCCESS
  regression_6020.1 FAILED
o regression_6020.2 Storage id: 80000000
E/TC:? 0 
E/TC:? 0 TA panicked with code 0xffff0000
E/LD:  Status of TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
E/LD:   arch: arm
E/LD:  region  0: va 0x40002000 pa 0x00000000 size 0x002000 flags rw-s (ldelf)
E/LD:  region  1: va 0x40004000 pa 0x00000000 size 0x006000 flags r-xs (ldelf)
E/LD:  region  2: va 0x4000a000 pa 0x00000000 size 0x001000 flags rw-s (ldelf)
E/LD:  region  3: va 0x4000b000 pa 0x00000000 size 0x004000 flags rw-s (ldelf)
E/LD:  region  4: va 0x4000f000 pa 0x00000000 size 0x001000 flags r--s
E/LD:  region  5: va 0x40010000 pa 0x00000000 size 0x001000 flags rw-s (stack)
E/LD:  region  6: va 0x40011000 pa 0xc820f868 size 0x001000 flags rw-- (param)
E/LD:  region  7: va 0x40012000 pa 0xc820f864 size 0x001000 flags rw-- (param)
E/LD:  region  8: va 0x4003c000 pa 0x00001000 size 0x00b000 flags r-xs [0]
E/LD:  region  9: va 0x40047000 pa 0x0000c000 size 0x014000 flags rw-s [0]
E/LD:   [0] b689f2a7-8adf-477a-9f99-32e90c0ad0a2 @ 0x4003c000
E/LD:  Call stack:
E/LD:   0x4003fb84
E/LD:   0x4003dbe1
E/LD:   0x4003c0e7
E/LD:   0x40040491
E/LD:   0x40044e9f
E/LD:   0x4003c8f4
/usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/host/xtest/regression_6000.c:1955: res has an unexpected value: 0xffff3024 = TEE_ERROR_TARGET_DEAD, expected 0x0 = TEEC_SUCCESS
/usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/host/xtest/regression_6000.c:2053: fs_unlink(&sess, obj) has an unexpected value: 0xffff3024 = TEE_ERROR_TARGET_DEAD, expected 0x0 = TEEC_SUCCESS
  regression_6020.2 FAILED
  regression_6020 FAILED
jforissier commented 3 years ago

Hi @aleksandarn-ee,

Please run the symbolize script to translate the call stack addresses into human-readable information. See https://optee.readthedocs.io/en/latest/debug/abort_dumps.html. Note that since you are getting TA panics, the stack dump will likely not point to the exact location where error occurred (libutee typically calls panic after an internal function has returned an error that should be translated into a panic as per the GP spec), but it should still give valuable context information.

anik01ic commented 3 years ago

Is this script supposed to be run on the host or on the target?

jforissier commented 3 years ago

On the host.

anik01ic commented 3 years ago

Somehow it doesn't work. I have sourced the STM SDK (and I guess the toolchain with it), but instead of getting the call stack, I am getting question marks.

I have noted something very interestingly though. In our case, we have a separate data partition mounted on /data. In this case the above subtests fail. However, when I unmount the data partition meaning OP-TEE uses a normal /data directory on our rootfs partition, all the tests cases succeed. Any ideas what might cause such behaviour?

jforissier commented 3 years ago

Somehow it doesn't work. I have sourced the STM SDK (and I guess the toolchain with it), but instead of getting the call stack, I am getting question marks.

Is arm-linux-gnueabihf-addr2line in your $PATH? Did you give the correct path to b689f2a7-8adf-477a-9f99-32e90c0ad0a2.elf? (-d argument, you may give the directory where the file is or the file itself).

I have noted something very interestingly though. In our case, we have a separate data partition mounted on /data. In this case the above subtests fail. However, when I unmount the data partition meaning OP-TEE uses a normal /data directory on our rootfs partition, all the tests cases succeed. Any ideas what might cause such behaviour?

No, in theory you should be able to do that. I looks like secure storage works for a while (the beginning of 6018.1 is OK) then something breaks and no more secure storage operation is possible. I'm afraid you will need to add some debug traces to find out what's happening.

Edit: tracing tee-supplicant with strace --trace=file might also give a clue.

anik01ic commented 3 years ago

I managed to symbolize the dump, have to point out though that in my case it only works for <uuid>.elf and not for <uuid>.stripped.elf (and according to the documentation one should be able to use both files). Here is the symbolized dump of the first regression test that failed - regression_6018.1:

o regression_6018.1 Storage id: 00000001
writing 0
writing 1
writing 2
writing 3
writing 4
writing 5
E/TC:? 0 
E/TC:? 0 TA panicked with code 0xffff0000
E/LD:  Status of TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
E/LD:   arch: arm
E/LD:  region  0: va 0x40002000 pa 0x00000000 size 0x002000 flags rw-s (ldelf)
E/LD:  region  1: va 0x40004000 pa 0x00000000 size 0x006000 flags r-xs (ldelf)
E/LD:  region  2: va 0x4000a000 pa 0x00000000 size 0x001000 flags rw-s (ldelf)
E/LD:  region  3: va 0x4000b000 pa 0x00000000 size 0x004000 flags rw-s (ldelf)
E/LD:  region  4: va 0x4000f000 pa 0x00000000 size 0x001000 flags r--s
E/LD:  region  5: va 0x40010000 pa 0x00000000 size 0x001000 flags rw-s (stack)
E/LD:  region  6: va 0x40011000 pa 0xc6d15c18 size 0x009000 flags rw-- (param)
E/LD:  region  7: va 0x40038000 pa 0x00001000 size 0x00b000 flags r-xs [0] .ta_head .text .rodata .gnu.hash .ARM.extab .ARM.exidx .dynsym .dynstr .hash
E/LD:  region  8: va 0x40043000 pa 0x0000c000 size 0x014000 flags rw-s [0] .dynamic .got .rel.got .data .bss .rel.dyn
E/LD:   [0] b689f2a7-8adf-477a-9f99-32e90c0ad0a2 @ 0x40038000 (xtest_fail/b689f2a7-8adf-477a-9f99-32e90c0ad0a2.elf)
E/LD:  Call stack:
E/LD:   0x4003bb84 _utee_panic bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/arch/arm/utee_syscalls_a32.S:51
E/LD:   0x40039deb TEE_WriteObjectData bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/tee_api_objects.c:682
E/LD:   0x40038219 ta_storage_cmd_write bei /usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/ta/storage/storage.c:201
E/LD:   0x4003c491 entry_invoke_command bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/arch/arm/user_ta_entry.c:357
E/LD:   0x40040e9f __ta_entry_c bei /usr/include/optee/export-user_ta/src/user_ta_header.c:48
E/LD:   0x400388f4 __ta_entry bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/recipe-sysroot/usr/include/optee/export-user_ta/src/ta_entry_a32.S:20
/usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/host/xtest/regression_6000.c:1707: fs_write(&sess, obj, block, block_size) has an unexpected value: 0xffff3024 = TEE_ERROR_TARGET_DEAD, expected 0x0 = TEEC_SUCCESS

Any clues what I should look for?

PS: Sorry for the German language in the dump, it comes from the compiler :)

anik01ic commented 3 years ago

I did a small research and I guess the function that causes the error is this one. Why however, no idea, not really fit with the assembly language.

jenswi-linaro commented 3 years ago

This means that is https://github.com/OP-TEE/optee_os/blob/760a08351f9d8529ad91933ff39b4cbb7481b868/core/tee/tee_svc_storage.c#L377-L380 which is returning an error which causes the panic.

anik01ic commented 3 years ago

This means that is https://github.com/OP-TEE/optee_os/blob/760a08351f9d8529ad91933ff39b4cbb7481b868/core/tee/tee_svc_storage.c#L377-L380 which is returning an error which causes the panic.

@jforissier Should I add debug lines in the function above to find out which function call actually fails or you could tell more based on the symbolized dump?

etienne-lms commented 3 years ago

From traces it seems TA rather panicked in TEE_WriteObjectData() because _utee_storage_obj_write() returned an unexpected TEE_ERROR_GENERIC error code. You may need to increase core log level (try CFG_TEE_CORE_LOG_LEVEL=3) to find why/where the syscall function failed. The syscall core function is syscall_storage_obj_write().

anik01ic commented 3 years ago

I increased core log level to 3, and set CFG_UNWIND=y. The symbolized dump is below. Any ideas?


* regression_6018 Large object
o regression_6018.1 Storage id: 00000001D/TC:? 0 ldelf_load_ldelf:91 ldelf load address 0x40004000

D/LD:  ldelf:134 Loading TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (Secure Storage TA)
D/TC:? 0 ldelf_syscall_open_bin:144 res=0xffff0008
D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (REE)
D/TC:? 0 ldelf_syscall_open_bin:144 res=0
D/LD:  ldelf:168 ELF (b689f2a7-8adf-477a-9f99-32e90c0ad0a2) at 0x40075000
writing 0
writing 1
writing 2
writing 3
writing 4
writing 5
E/TC:? 0 
E/TC:? 0 TA panicked with code 0xffff0000
E/LD:  Status of TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
E/LD:   arch: arm
E/LD:  region  0: va 0x40002000 pa 0x00000000 size 0x002000 flags rw-s (ldelf)
E/LD:  region  1: va 0x40004000 pa 0x00000000 size 0x006000 flags r-xs (ldelf)
E/LD:  region  2: va 0x4000a000 pa 0x00000000 size 0x001000 flags rw-s (ldelf)
E/LD:  region  3: va 0x4000b000 pa 0x00000000 size 0x004000 flags rw-s (ldelf)
E/LD:  region  4: va 0x4000f000 pa 0x00000000 size 0x001000 flags r--s
E/LD:  region  5: va 0x40010000 pa 0x00000000 size 0x001000 flags rw-s (stack)
E/LD:  region  6: va 0x40011000 pa 0xc6c3cc18 size 0x009000 flags rw-- (param)
E/LD:  region  7: va 0x40075000 pa 0x00001000 size 0x00b000 flags r-xs [0] .ta_head .text .rodata .gnu.hash .ARM.extab .ARM.exidx .dynsym .dynstr .hash
E/LD:  region  8: va 0x40080000 pa 0x0000c000 size 0x014000 flags rw-s [0] .dynamic .got .rel.got .data .bss .rel.dyn
E/LD:   [0] b689f2a7-8adf-477a-9f99-32e90c0ad0a2 @ 0x40075000 (xtest_fail/b689f2a7-8adf-477a-9f99-32e90c0ad0a2.elf)
E/LD:  Call stack:
E/LD:   0x40078b84 _utee_panic bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/arch/arm/utee_syscalls_a32.S:51
E/LD:   0x40076deb TEE_WriteObjectData bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/tee_api_objects.c:682
E/LD:   0x40075219 ta_storage_cmd_write bei /usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/ta/storage/storage.c:201
E/LD:   0x40079491 entry_invoke_command bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/arch/arm/user_ta_entry.c:357
E/LD:   0x4007de9f __ta_entry_c bei /usr/include/optee/export-user_ta/src/user_ta_header.c:48
E/LD:   0x400758f4 __ta_entry bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/recipe-sysroot/usr/include/optee/export-user_ta/src/ta_entry_a32.S:20
D/TC:? 0 user_ta_enter:176 tee_user_ta_enter: TA panicked with code 0xffff0000
D/TC:? 0 destroy_ta_ctx_from_session:326 Remove references to context (0x2ffe32e4)
D/TC:? 0 destroy_context:310 Destroy TA ctx (0x2ffe32d8)
/usr/src/debug/opD/TC:? 0 tee_ta_close_session:514 csess 0x2ffe3830 id 17
tee-testD/TC:? 0 tee_ta_close_session:533 Destroy session
/3.12.0+gitD/TC:? 0 tee_ta_init_pseudo_ta_session:299 Lookup pseudo TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
AUTOINC+7be42398e8-r0/git/host/xtest/regression_6000.c:1707: fs_write(&sess, obj, block, block_size)D/TC:? 0 ldelf_load_ldelf:91 ldelf load address 0x40004000
 has an unexpected value: 0xffff3024D/LD:  ldelf:134 Loading TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
 = TEE_ERROR_TARGET_DEAD, expected 0x0 = TEEC_SUCCESS
  regression_6018.1 FAILED
o regrD/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (Secure Storage TA)
ession_6018.2 Storage id: 80000000
D/TC:? 0 ldelf_syscall_open_bin:144 res=0xffff0008
D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (REE)
D/TC:? 0 ldelf_syscall_open_bin:144 res=0
D/LD:  ldelf:168 ELF (b689f2a7-8adf-477a-9f99-32e90c0ad0a2) at 0x40089000
E/TC:? 0 
E/TC:? 0 TA panicked with code 0xffff0000
E/LD:  Status of TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
E/LD:   arch: arm
E/LD:  region  0: va 0x40002000 pa 0x00000000 size 0x002000 flags rw-s (ldelf)
E/LD:  region  1: va 0x40004000 pa 0x00000000 size 0x006000 flags r-xs (ldelf)
E/LD:  region  2: va 0x4000a000 pa 0x00000000 size 0x001000 flags rw-s (ldelf)
E/LD:  region  3: va 0x4000b000 pa 0x00000000 size 0x004000 flags rw-s (ldelf)
E/LD:  region  4: va 0x4000f000 pa 0x00000000 size 0x001000 flags r--s
E/LD:  region  5: va 0x40010000 pa 0x00000000 size 0x001000 flags rw-s (stack)
E/LD:  region  6: va 0x40011000 pa 0xc6901864 size 0x001000 flags rw-- (param)
E/LD:  region  7: va 0x40089000 pa 0x00001000 size 0x00b000 flags r-xs [0] .ta_head .text .rodata .gnu.hash .ARM.extab .ARM.exidx .dynsym .dynstr .hash
E/LD:  region  8: va 0x40094000 pa 0x0000c000 size 0x014000 flags rw-s [0] .dynamic .got .rel.got .data .bss .rel.dyn
E/LD:   [0] b689f2a7-8adf-477a-9f99-32e90c0ad0a2 @ 0x40089000 (xtest_fail/b689f2a7-8adf-477a-9f99-32e90c0ad0a2.elf)
E/LD:  Call stack:
E/LD:   0x4008cb84 _utee_panic bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/arch/arm/utee_syscalls_a32.S:51
E/LD:   0x4008abe1 TEE_CreatePersistentObject bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/tee_api_objects.c:460
E/LD:   0x400890e7 ta_storage_cmd_create bei /usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/ta/storage/storage.c:94
E/LD:   0x4008d491 entry_invoke_command bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/arch/arm/user_ta_entry.c:357
E/LD:   0x40091e9f __ta_entry_c bei /usr/include/optee/export-user_ta/src/user_ta_header.c:48
E/LD:   0x400898f4 __ta_entry bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/recipe-sysroot/usr/include/optee/export-user_ta/src/ta_entry_a32.S:20
D/TC:? 0 user_ta_enter:176 tee_user_ta_enter: TA panicked with code 0xffff0000
D/TC:? 0 destroy_ta_ctx_from_session:326 Remove references to context (0x2ffe32e4)
D/TC:? 0 destroy_context:310 Destroy TA ctx (0x2ffe32d8)
/usr/src/debug/opD/TC:? 0 tee_ta_close_session:514 csess 0x2ffe3830 id 17
tee-test/D/TC:? 0 tee_ta_close_session:533 Destroy session
3.12.0+gitD/TC:? 0 tee_ta_init_pseudo_ta_session:299 Lookup pseudo TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
AUTOINC+7be42398e8-r0/git/host/xtest/regression_6000.c:1697: fs_create(&sess, file_D/TC:? 0 ldelf_load_ldelf:91 ldelf load address 0x40004000
01, sizeof(file_01), 0x00000002, 0, D/LD:  ldelf:134 Loading TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
((void *)0), 0, &obj, storage_id) has an unexpected value: 0xffff3024 = TEE_ERROR_TARGET_D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (Secure Storage TA)
DEAD, expected 0x0 = TEEC_SUCCESS
  regression_6018.2 FAILED
  regression_6018 FAILED

* regression_6019 Storage independence
o regression_6019.1 Storage id: 00000001
D/TC:? 0 ldelf_syscall_open_bin:144 res=0xffff0008
D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (REE)
D/TC:? 0 ldelf_syscall_open_bin:144 res=0
D/LD:  ldelf:168 ELF (b689f2a7-8adf-477a-9f99-32e90c0ad0a2) at 0x40068000
D/TC:? 0 tee_ta_init_pseudo_ta_session:299 Lookup pseudo TA 731e279e-aafb-4575-a771-38caa6f0cca6
D/TC:? 0 ldelf_load_ldelf:91 ldelf load address 0x40004000
D/LD:  ldelf:134 Loading TA 731e279e-aafb-4575-a771-38caa6f0cca6
D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF 731e279e-aafb-4575-a771-38caa6f0cca6 (Secure Storage TA)
D/TC:? 0 ldelf_syscall_open_bin:144 res=0xffff0008
D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF 731e279e-aafb-4575-a771-38caa6f0cca6 (REE)
D/TC:? 0 ldelf_syscall_open_bin:144 res=0
D/LD:  ldelf:168 ELF (731e279e-aafb-4575-a771-38caa6f0cca6) at 0x40088000
E/TC:? 0 
E/TC:? 0 TA panicked with code 0xffff0000
E/LD:  Status of TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
E/LD:   arch: arm
E/LD:  region  0: va 0x40002000 pa 0x00000000 size 0x002000 flags rw-s (ldelf)
E/LD:  region  1: va 0x40004000 pa 0x00000000 size 0x006000 flags r-xs (ldelf)
E/LD:  region  2: va 0x4000a000 pa 0x00000000 size 0x001000 flags rw-s (ldelf)
E/LD:  region  3: va 0x4000b000 pa 0x00000000 size 0x004000 flags rw-s (ldelf)
E/LD:  region  4: va 0x4000f000 pa 0x00000000 size 0x001000 flags r--s
E/LD:  region  5: va 0x40010000 pa 0x00000000 size 0x001000 flags rw-s (stack)
E/LD:  region  6: va 0x40011000 pa 0xc6901868 size 0x001000 flags rw-- (param)
E/LD:  region  7: va 0x40012000 pa 0xc6901864 size 0x001000 flags rw-- (param)
E/LD:  region  8: va 0x40068000 pa 0x00001000 size 0x00b000 flags r-xs [0] .ta_head .text .rodata .gnu.hash .ARM.extab .ARM.exidx .dynsym .dynstr .hash
E/LD:  region  9: va 0x40073000 pa 0x0000c000 size 0x014000 flags rw-s [0] .dynamic .got .rel.got .data .bss .rel.dyn
E/LD:   [0] b689f2a7-8adf-477a-9f99-32e90c0ad0a2 @ 0x40068000 (xtest_fail/b689f2a7-8adf-477a-9f99-32e90c0ad0a2.elf)
E/LD:  Call stack:
E/LD:   0x4006bb84 _utee_panic bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/arch/arm/utee_syscalls_a32.S:51
E/LD:   0x40069be1 TEE_CreatePersistentObject bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/tee_api_objects.c:460
E/LD:   0x400680e7 ta_storage_cmd_create bei /usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/ta/storage/storage.c:94
E/LD:   0x4006c491 entry_invoke_command bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/arch/arm/user_ta_entry.c:357
E/LD:   0x40070e9f __ta_entry_c bei /usr/include/optee/export-user_ta/src/user_ta_header.c:48
E/LD:   0x400688f4 __ta_entry bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/recipe-sysroot/usr/include/optee/export-user_ta/src/ta_entry_a32.S:20
D/TC:? 0 user_ta_enter:176 tee_user_ta_enter: TA panicked with code 0xffff0000
D/TC:? 0 destroy_ta_ctx_from_session:326 Remove references to context (0x2ffe32e4)
D/TC:? 0 destroy_context:310 Destroy TA ctx (0x2ffe32d8)
/usr/src/debug/opD/TC:? 0 tee_ta_close_session:514 csess 0x2ffe2c68 id 18
tee-testD/TC:? 0 tee_ta_close_session:533 Destroy session
/3.12.0+gitAUTOINC+7be42398e8-r0/git/host/xtest/regression_6000.c:1784: fs_create(&sess, file_01, sizeof(file_01), 0x00000002 | 0x00000004 | 0x00000400, 0, data_00, sizeof(data_00), &obj, storage_id) has an unexpected valuD/TC:? 0 destroy_context:310 Destroy TA ctx (0x2ffe2c28)
e: 0xffff3024 = TEE_ERROR_TARGET_DEAD, expeD/TC:? 0 tee_ta_close_session:514 csess 0x2ffe3830 id 17
cted 0x0 D/TC:? 0 tee_ta_close_session:533 Destroy session
= TEEC_SUCCESS
  regrD/TC:? 0 tee_ta_init_pseudo_ta_session:299 Lookup pseudo TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
ession_6019.1 FAILED
o regression_6019.2 Storage id: 80000000
D/TC:? 0 ldelf_load_ldelf:91 ldelf load address 0x40004000
D/LD:  ldelf:134 Loading TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (Secure Storage TA)
D/TC:? 0 ldelf_syscall_open_bin:144 res=0xffff0008
D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (REE)
D/TC:? 0 ldelf_syscall_open_bin:144 res=0
D/LD:  ldelf:168 ELF (b689f2a7-8adf-477a-9f99-32e90c0ad0a2) at 0x40023000
D/TC:? 0 tee_ta_init_pseudo_ta_session:299 Lookup pseudo TA 731e279e-aafb-4575-a771-38caa6f0cca6
D/TC:? 0 ldelf_load_ldelf:91 ldelf load address 0x40004000
D/LD:  ldelf:134 Loading TA 731e279e-aafb-4575-a771-38caa6f0cca6
D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF 731e279e-aafb-4575-a771-38caa6f0cca6 (Secure Storage TA)
D/TC:? 0 ldelf_syscall_open_bin:144 res=0xffff0008
D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF 731e279e-aafb-4575-a771-38caa6f0cca6 (REE)
D/TC:? 0 ldelf_syscall_open_bin:144 res=0
D/LD:  ldelf:168 ELF (731e279e-aafb-4575-a771-38caa6f0cca6) at 0x4004c000
E/TC:? 0 
E/TC:? 0 TA panicked with code 0xffff0000
E/LD:  Status of TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
E/LD:   arch: arm
E/LD:  region  0: va 0x40002000 pa 0x00000000 size 0x002000 flags rw-s (ldelf)
E/LD:  region  1: va 0x40004000 pa 0x00000000 size 0x006000 flags r-xs (ldelf)
E/LD:  region  2: va 0x4000a000 pa 0x00000000 size 0x001000 flags rw-s (ldelf)
E/LD:  region  3: va 0x4000b000 pa 0x00000000 size 0x004000 flags rw-s (ldelf)
E/LD:  region  4: va 0x4000f000 pa 0x00000000 size 0x001000 flags r--s
E/LD:  region  5: va 0x40010000 pa 0x00000000 size 0x001000 flags rw-s (stack)
E/LD:  region  6: va 0x40011000 pa 0xc6901868 size 0x001000 flags rw-- (param)
E/LD:  region  7: va 0x40012000 pa 0xc6901864 size 0x001000 flags rw-- (param)
E/LD:  region  8: va 0x40023000 pa 0x00001000 size 0x00b000 flags r-xs [0] .ta_head .text .rodata .gnu.hash .ARM.extab .ARM.exidx .dynsym .dynstr .hash
E/LD:  region  9: va 0x4002e000 pa 0x0000c000 size 0x014000 flags rw-s [0] .dynamic .got .rel.got .data .bss .rel.dyn
E/LD:   [0] b689f2a7-8adf-477a-9f99-32e90c0ad0a2 @ 0x40023000 (xtest_fail/b689f2a7-8adf-477a-9f99-32e90c0ad0a2.elf)
E/LD:  Call stack:
E/LD:   0x40026b84 _utee_panic bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/arch/arm/utee_syscalls_a32.S:51
E/LD:   0x40024be1 TEE_CreatePersistentObject bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/tee_api_objects.c:460
E/LD:   0x400230e7 ta_storage_cmd_create bei /usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/ta/storage/storage.c:94
E/LD:   0x40027491 entry_invoke_command bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/arch/arm/user_ta_entry.c:357
E/LD:   0x4002be9f __ta_entry_c bei /usr/include/optee/export-user_ta/src/user_ta_header.c:48
E/LD:   0x400238f4 __ta_entry bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/recipe-sysroot/usr/include/optee/export-user_ta/src/ta_entry_a32.S:20
D/TC:? 0 user_ta_enter:176 tee_user_ta_enter: TA panicked with code 0xffff0000
D/TC:? 0 destroy_ta_ctx_from_session:326 Remove references to context (0x2ffe32e4)
D/TC:? 0 destroy_context:310 Destroy TA ctx (0x2ffe32d8)
/usr/src/debug/optee-test/3.12.0+gitAUTOD/TC:? 0 tee_ta_close_session:514 csess 0x2ffe2c68 id 18
INC+7be42D/TC:? 0 tee_ta_close_session:533 Destroy session
398e8-r0/git/host/xtest/regression_6000.c:1784: fs_create(&sess, file_01, sizeof(file_01), 0x00000002 | 0x00000004 | 0x00000400, 0, data_00, sizeof(data_00), &obj, storage_id) has an unexpected value: 0xffff3024 = TEE_ERROR_TARGET_DED/TC:? 0 destroy_context:310 Destroy TA ctx (0x2ffe2c28)
AD, expected 0x0 = TEEC_SUCCESS
D/TC:? 0 tee_ta_close_session:514 csess 0x2ffe3830 id 17
D/TC:? 0 tee_ta_close_session:533 Destroy session
  regression_6019.2 FAILD/TC:? 0 tee_ta_init_pseudo_ta_session:299 Lookup pseudo TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
ED
  regression_6019 FAILED

* regression_6020 Object IDs in SHM (negative)
D/TC:? 0 ldelf_load_ldelf:91 ldelf load address 0x40004000
o regression_6020.1 Storage id: 0000D/LD:  ldelf:134 Loading TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
0001
D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (Secure Storage TA)
D/TC:? 0 ldelf_syscall_open_bin:144 res=0xffff0008
D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (REE)
D/TC:? 0 ldelf_syscall_open_bin:144 res=0
D/LD:  ldelf:168 ELF (b689f2a7-8adf-477a-9f99-32e90c0ad0a2) at 0x40065000
E/TC:? 0 
E/TC:? 0 TA panicked with code 0xffff0000
E/LD:  Status of TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
E/LD:   arch: arm
E/LD:  region  0: va 0x40002000 pa 0x00000000 size 0x002000 flags rw-s (ldelf)
E/LD:  region  1: va 0x40004000 pa 0x00000000 size 0x006000 flags r-xs (ldelf)
E/LD:  region  2: va 0x4000a000 pa 0x00000000 size 0x001000 flags rw-s (ldelf)
E/LD:  region  3: va 0x4000b000 pa 0x00000000 size 0x004000 flags rw-s (ldelf)
E/LD:  region  4: va 0x4000f000 pa 0x00000000 size 0x001000 flags r--s
E/LD:  region  5: va 0x40010000 pa 0x00000000 size 0x001000 flags rw-s (stack)
E/LD:  region  6: va 0x40011000 pa 0xc6901868 size 0x001000 flags rw-- (param)
E/LD:  region  7: va 0x40012000 pa 0xc6901864 size 0x001000 flags rw-- (param)
E/LD:  region  8: va 0x40065000 pa 0x00001000 size 0x00b000 flags r-xs [0] .ta_head .text .rodata .gnu.hash .ARM.extab .ARM.exidx .dynsym .dynstr .hash
E/LD:  region  9: va 0x40070000 pa 0x0000c000 size 0x014000 flags rw-s [0] .dynamic .got .rel.got .data .bss .rel.dyn
E/LD:   [0] b689f2a7-8adf-477a-9f99-32e90c0ad0a2 @ 0x40065000 (xtest_fail/b689f2a7-8adf-477a-9f99-32e90c0ad0a2.elf)
E/LD:  Call stack:
E/LD:   0x40068b84 _utee_panic bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/arch/arm/utee_syscalls_a32.S:51
E/LD:   0x40066be1 TEE_CreatePersistentObject bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/tee_api_objects.c:460
E/LD:   0x400650e7 ta_storage_cmd_create bei /usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/ta/storage/storage.c:94
E/LD:   0x40069491 entry_invoke_command bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/arch/arm/user_ta_entry.c:357
E/LD:   0x4006de9f __ta_entry_c bei /usr/include/optee/export-user_ta/src/user_ta_header.c:48
E/LD:   0x400658f4 __ta_entry bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/recipe-sysroot/usr/include/optee/export-user_ta/src/ta_entry_a32.S:20
D/TC:? 0 user_ta_enter:176 tee_user_ta_enter: TA panicked with code 0xffff0000
D/TC:? 0 destroy_ta_ctx_from_session:326 Remove references to context (0x2ffe32e4)
D/TC:? 0 destroy_context:310 Destroy TA ctx (0x2ffe32d8)
/usr/src/debug/optD/TC:? 0 tee_ta_close_session:514 csess 0x2ffe3830 id 17
ee-test/D/TC:? 0 tee_ta_close_session:533 Destroy session
3.12.0+gitAD/TC:? 0 tee_ta_init_pseudo_ta_session:299 Lookup pseudo TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
UTOINC+7be42398e8-r0/git/host/xtest/regression_6000.c:1955: res has an unexpected D/TC:? 0 ldelf_load_ldelf:91 ldelf load address 0x40004000
value: 0xffff3024 = TEE_ERROR_TARGET_DD/LD:  ldelf:134 Loading TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
EAD, expected 0x0 = TEEC_SUCCESS
/usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (Secure Storage TA)
r0/git/host/xtest/regression_6000.c:2053: fs_unlink(&sess, obj) has an unexpected value: 0xffff3024 = TEE_ERROR_TARGET_DEAD, expected 0x0 = TEEC_SUCCESS
  regression_6020.1 FAILED
o regression_6020.2 Storage id: 80000000
D/TC:? 0 ldelf_syscall_open_bin:144 res=0xffff0008
D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF b689f2a7-8adf-477a-9f99-32e90c0ad0a2 (REE)
D/TC:? 0 ldelf_syscall_open_bin:144 res=0
D/LD:  ldelf:168 ELF (b689f2a7-8adf-477a-9f99-32e90c0ad0a2) at 0x4005f000
E/TC:? 0 
E/TC:? 0 TA panicked with code 0xffff0000
E/LD:  Status of TA b689f2a7-8adf-477a-9f99-32e90c0ad0a2
E/LD:   arch: arm
E/LD:  region  0: va 0x40002000 pa 0x00000000 size 0x002000 flags rw-s (ldelf)
E/LD:  region  1: va 0x40004000 pa 0x00000000 size 0x006000 flags r-xs (ldelf)
E/LD:  region  2: va 0x4000a000 pa 0x00000000 size 0x001000 flags rw-s (ldelf)
E/LD:  region  3: va 0x4000b000 pa 0x00000000 size 0x004000 flags rw-s (ldelf)
E/LD:  region  4: va 0x4000f000 pa 0x00000000 size 0x001000 flags r--s
E/LD:  region  5: va 0x40010000 pa 0x00000000 size 0x001000 flags rw-s (stack)
E/LD:  region  6: va 0x40011000 pa 0xc6901868 size 0x001000 flags rw-- (param)
E/LD:  region  7: va 0x40012000 pa 0xc6901864 size 0x001000 flags rw-- (param)
E/LD:  region  8: va 0x4005f000 pa 0x00001000 size 0x00b000 flags r-xs [0] .ta_head .text .rodata .gnu.hash .ARM.extab .ARM.exidx .dynsym .dynstr .hash
E/LD:  region  9: va 0x4006a000 pa 0x0000c000 size 0x014000 flags rw-s [0] .dynamic .got .rel.got .data .bss .rel.dyn
E/LD:   [0] b689f2a7-8adf-477a-9f99-32e90c0ad0a2 @ 0x4005f000 (xtest_fail/b689f2a7-8adf-477a-9f99-32e90c0ad0a2.elf)
E/LD:  Call stack:
E/LD:   0x40062b84 _utee_panic bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/arch/arm/utee_syscalls_a32.S:51
E/LD:   0x40060be1 TEE_CreatePersistentObject bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/tee_api_objects.c:460
E/LD:   0x4005f0e7 ta_storage_cmd_create bei /usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/git/ta/storage/storage.c:94
E/LD:   0x40063491 entry_invoke_command bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-os-stm32mp/3.12.0.r1-r0/git/lib/libutee/arch/arm/user_ta_entry.c:357
E/LD:   0x40067e9f __ta_entry_c bei /usr/include/optee/export-user_ta/src/user_ta_header.c:48
E/LD:   0x4005f8f4 __ta_entry bei /srv/alenik/tq/oeswa63/git/development/main/sub/yocto/build-oeswa63core-stm32mp151c-oeswa63/tmp-glibc/work/stm32mp151c_oeswa63-ostl-linux-gnueabi/optee-test/3.12.0+gitAUTOINC+7be42398e8-r0/recipe-sysroot/usr/include/optee/export-user_ta/src/ta_entry_a32.S:20
D/TC:? 0 user_ta_enter:176 tee_user_ta_enter: TA panicked with code 0xffff0000
D/TC:? 0 destroy_ta_ctx_from_session:326 Remove references to context (0x2ffe32e4)
D/TC:? 0 destroy_context:310 Destroy TA ctx (0x2ffe32d8)
/usr/src/debug/optD/TC:? 0 tee_ta_close_session:514 csess 0x2ffe3830 id 17
ee-test/3D/TC:? 0 tee_ta_close_session:533 Destroy session
.12.0+gitAUD/TC:? 0 tee_ta_init_pseudo_ta_session:299 Lookup pseudo TA cb3e5ba0-adf1-11e0-998b-0002a5d5c51b
TOINC+7be42398e8-r0/git/host/xtest/regression_6000.c:1955: res has an unexpected D/TC:? 0 ldelf_load_ldelf:91 ldelf load address 0x40004000
value: 0xffff3024 = TEE_ERROR_TARGET_DD/LD:  ldelf:134 Loading TA cb3e5ba0-adf1-11e0-998b-0002a5d5c51b
EAD, expected 0x0 = TEEC_SUCCESS
/usr/src/debug/optee-test/3.12.0+gitAUTOINC+7be42398e8D/TC:? 0 ldelf_syscall_open_bin:140 Lookup user TA ELF cb3e5ba0-adf1-11e0-998b-0002a5d5c51b (Secure Storage TA)
-r0/git/host/xtest/regression_6000.c:2053: fs_unlink(&sess, obj) has an unexpected value: 0xffff3024 = TEE_ERROR_TARGET_DEAD, expected 0x0 = TEEC_SUCCESS
  regression_6020.2 FAILED
  regression_6020 FAILED```
etienne-lms commented 3 years ago

No specific debug traces concerning your issue. You'll need to add traces (I.e. EMSG("...");) in optee_os, starting from syscall_storage_obj_write() to find which ineternal function failed.

anik01ic commented 3 years ago

I added some debug prints and found out the following. The function syscall_storage_obj_write() fails here with the following exit code: 0xFFFF0000. Any idea which function gets called for write purposes?

anik01ic commented 3 years ago

Any idea which function is called with res = o->pobj->fops->write(o->fh, pos_tmp, data, len); (here)? Then I could debug further and see what the cause of the problem is.

jforissier commented 3 years ago

@aleksandarn-ee assuming that CFG_REE_FS=y and CFG_RPMB_FS=n in your build (that's the default config; check with grep CFG.*FS= out/arm*/conf.mk), then the write function should be ree_fs_write_primitive() here.

github-actions[bot] commented 3 years ago

This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this issue will automatically be closed in 5 days. Note that you can always re-open a closed issue at any time.