type
status
date
slug
summary
tags
category
icon
password
The code is based on: https://gitlab.com/riseproject/riscv-optee/optee_os/-/tree/dev-optee-mpxy
Commit ID:
75df9ba41a404aec897399ead0ff0aebcbff48ca
ldelf_hex.c
is generated byscripts/gen_ldelf_hex.py
from the input file:ldelf.elf
and is included by OP-TEE, i.e.ldelf_data[]
,ldelf_code_size
,ldelf_data_size
, andldelf_entry
.ldelf
sources:<optee-src>/ldelf/
ldelf
is running in U-mode.
scall_handle_ldelf()
- Handle syscall according to
ldelf_syscall_table
:
_ldelf_start()
ldelf()
ta_elf_load_main()
load_main()
init_elf()
sys_open_ta_bin()
_ldelf_open_bin()
- Issue
LDELF_OPEN_BIN
syscall, which will eventually callldelf_syscall_open_bin()
_ldelf_return()
- Issue
LDELF_RETURN
syscall, which will eventually callsyscall_sys_return()
ldelf_syscall_open_bin()
- If the session is for user TAs, look up user TA ELF by UUID. Currently, there are three ways (TA storages) to load user TA in OP-TEE:
- Early TA
- REE filesystem TA
- REE-FS TA rollback protection
- Each TA storage is registered by
REGISTER_TA_STORE()
and is stored intota_stores
scattered array in the priority order, e.g. - Early TA:
- Secure Storage TA:
- REE filesystem TA:
- Iterates each TA storage, call their
op->open()
callback, e.g.ree_fs_ta_open()
. - Each TA storage's
op->open()
is responsible for comparing UUID (either by itself or through thread RPC) to determine whether user TA for UUID can be found or not. - Returns
TEE_ERROR_ITEM_NOT_FOUND
if user TA for UUID cannot be found.