Oopenvela-robotoptee/rpmb: rpmbfs support to read multi blocks
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
external/optee_os: Fix entry_std.c log warning CC: sched/sched_getfiles.c In file included from /mnt/yang/vela_n60_optee/apps/external/optee/optee_nuttx/optee_nuttx/include/assert.h:28, from optee_os/core/tee/entry_std.c:7: optee_os/core/tee/entry_std.c: In function '__tee_entry_std': optee_os/core/tee/entry_std.c:587:22: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=] 587 | EMSG("Unknown cmd 0x%x", arg->cmd); | ^~~~~~~~~~~~~~~~~~ ~~~~~~~~ | | | uint32_t {aka long unsigned int} optee_os/lib/libutils/ext/include/trace.h:41:22: note: in definition of macro 'trace_printf_helper' 41 | __VA_ARGS__) | ^~~~~~~~~~~ optee_os/core/tee/entry_std.c:587:17: note: in expansion of macro 'EMSG' 587 | EMSG("Unknown cmd 0x%x", arg->cmd); | ^~~~ optee_os/core/tee/entry_std.c:587:38: note: format string is defined here 587 | EMSG("Unknown cmd 0x%x", arg->cmd); | ~^ | | | unsigned int | %lx Signed-off-by: yanghuatao <yanghuatao@xiaomi.com> | 3 个月前 | |
core: FS: make dirfile interface accept empty object ID The TEE Internal Core API specification (v1.3.1) explicitly allows the use of an empty object ID in TEE_RenamePersistentObject(). The text is: newObjectID, newObjectIDLen: A buffer containing the new object identifier. The identifier contains arbitrary bytes, including the zero byte. The identifier length SHALL be less than or equal to TEE_OBJECT_ID_MAX_LEN and can be zero. (note the mention: "and can be zero"). Consequently, the OP-TEE filesystem code needs to accept an empty buffer as a valid object identifier. The REE FS implementation is not currently compatible with this because a null struct dirfile_entry::oidlen is considered unused (free). In order to differentiate between a free entry and one that represents an object with an empty name, this commit adds a condition on the first byte of struct dirfile_entry::oid. When zero, the structure is free; when non-zero, it is the empty object ID. A new helper function is introduced (is_free()) and used instead of simple tests on !oidlen. The tee_fs_dirfile_find() function is modified to be able to match the empty object ID. It used to interpret oidlen == 0 as a request to find a free entry; this logic is moved to an new function: tee_fs_dirfile_new(). The RPMB implementation (core/tee/tee_rpmb_fs.c) has no problem because it stores absolute object names including the TA UUID in a FAT structure like so: "/<TA UUID>/<Object ID in hexadecimal>". An empty object ID is therefore not a corner case. Link: https://github.com/OP-TEE/optee_os/issues/5171 Reported-by: Sadiq Hussain <sadiq.muchumarri@intel.com> Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> | 4 年前 | |
core: avoid TA panic when secure storage is corrupt init_head_from_data() triggers a TA panic in case corrupt data is read from the secure storage, for instance by request from the PKCS#11 trusted application. "Every Trusted Storage implementation is expected to return TEE_ERROR_CORRUPT_OBJECT if a Trusted Application attempts to open an object and the TEE determines that its contents (or those of the storage itself) have been tampered with or rolled back." See TEE Internal Core API Specification v1.1.2, section 5.7.1. Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Zengxx <zengxiaoxu@huawei.com> Signed-off-by: Joakim Nordell <joakim.nordell@axis.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> | 3 年前 | |
core: Fix warnings in core/tee/socket.c Fixes -Wdeclaration-after-statement warnings in core/tee/socket.c: core/tee/socket.c: In function ‘socket_open’: core/tee/socket.c:44:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct thread_param tpm[4] = { ^~~~~~ core/tee/socket.c: In function ‘socket_close’: core/tee/socket.c:76:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct thread_param tpm = THREAD_PARAM_VALUE(IN, OPTEE_RPC_SOCKET_CLOSE, ^~~~~~ core/tee/socket.c: In function ‘socket_send’: core/tee/socket.c:108:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct thread_param tpm[3] = { ^~~~~~ core/tee/socket.c: In function ‘socket_recv’: core/tee/socket.c:147:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct thread_param tpm[3] = { ^~~~~~ core/tee/socket.c: In function ‘socket_ioctl’: core/tee/socket.c:190:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] struct thread_param tpm[3] = { ^~~~~~ Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> | 4 年前 | |
core: move FS files out of CFG_WITH_USER_TA Some files which are currently guarded with CFG_WITH_USER_TA should be guarded with _CFG_WITH_SECURE_STORAGE or FS-specific configs (CFG_RPMB_FS, CFG_RPMB_FS). This will allow the use of secure storage from kernel code when CFG_WITH_USER_TA=n. Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> | 4 年前 | |
core: make mobj_get_va() more secure Adds a length parameter to allow mobj_get_va() to check that the entire va range requested is available. Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> | 4 年前 | |
core: merge tee_*_get_digest_size() into a single function Rename tee_hash_get_digest_size() to tee_alg_get_digest_size(). Change tee_alg_get_digest_size() to use new libutee macro TEE_ALG_GET_DIGEST_SIZE. Remove tee_mac_get_digest_size() as its functionality is handled by tee_alg_get_digest_size() now. Signed-off-by: Albert Schwarzkopf <a.schwarzkopf@phytec.de> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> | 6 年前 | |
core: merge tee_*_get_digest_size() into a single function Rename tee_hash_get_digest_size() to tee_alg_get_digest_size(). Change tee_alg_get_digest_size() to use new libutee macro TEE_ALG_GET_DIGEST_SIZE. Remove tee_mac_get_digest_size() as its functionality is handled by tee_alg_get_digest_size() now. Signed-off-by: Albert Schwarzkopf <a.schwarzkopf@phytec.de> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> | 6 年前 | |
core: merge tee_*_get_digest_size() into a single function Rename tee_hash_get_digest_size() to tee_alg_get_digest_size(). Change tee_alg_get_digest_size() to use new libutee macro TEE_ALG_GET_DIGEST_SIZE. Remove tee_mac_get_digest_size() as its functionality is handled by tee_alg_get_digest_size() now. Signed-off-by: Albert Schwarzkopf <a.schwarzkopf@phytec.de> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> | 6 年前 | |
core, libutee: introduce TEE_ALG_SM4_XTS In this patch, The sm4-xts algorithm is supported in the GP process. Signed-off-by: Pingan Xie <xiepingan3@huawei.com> Reviewed-by: Xiaoxu Zeng <zengxiaoxu@huawei.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> | 3 年前 | |
core: remove algo from crypto_mac_*() Removes the algo parameters from all crypto_mac_*() functions except crypto_mac_alloc_ctx(). Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> | 6 年前 | |
core: move tee_svc_storage_create_filename_dfh() to core/tee/tee_fs_rpc.c tee_svc_storage_create_filename_dfh() is only used in core/tee/tee_fs_rpc.c, so move it there, make it static and give it a shorter name: create_filename(). Fundamentally, this function is needed when CFG_REE_FS=y but the whole file core/tee/tee_svc_storage.c (which is the current location of this function) essentially defines the storage syscalls for TAs and is therefore not needed when CFG_WITH_USER_TA=n. If we want to later be able to exclude it from the build while still providing secure storage to kernel code, the function has to move. Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> | 4 年前 | |
core: replace tee_mmu prefix with vm Replaces the tee_mmu prefix with vm. tee_mmu.h is renamed to vm.h and core/arch/arm/mm/tee_mmu.c is moved to core/mm/vm.c. Public functions belonging to these files are renamed with a vm prefix. Introduces: vm_map_param(), vm_clean_param(), vm_buf_is_inside_private(), vm_buf_intersects_private(), vm_buf_to_mboj_offs(), vm_buf_is_inside_um_private(), vm_buf_intersects_um_private(), vm_add_rwmem(), vm_rem_rwmem(), vm_va2pa(), vm_pa2va(), vm_check_access_rights(), vm_set_ctx() replacing their tee_mmu_*() counterpart. Acked-by: Joakim Bech <joakim.bech@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> | 5 年前 | |
core: tee_pobj_get(): detect access conflict When tee_pobj_get() is called with TEE_POBJ_USAGE_CREATE and without TEE_DATA_FLAG_OVERWRITE, and the persistent object is found in the list of open objects, the function should return TEE_ERROR_ACCESS_CONFLICT immediately. There is no need to call into the FS layer since we know the object exists at this point. Fixes: https://github.com/OP-TEE/optee_os/issues/4560 Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> | 5 年前 | |
core: add CFG_REE_FS_INTEGRITY_RPMB for roll-back protection of REE If we enable CFG_RPMB_FS and CFG_REE_FS at the same time in optee-os, with tee-supplicant only supports REE, calls from xtest to ree_fs_open() will attempt to access RPMB for roll-back protection, which will fail because tee-supplicant can't access RPMB. In some platforms, we only want optee-os to support RPMB key provision checking by invoking any RPMB read/writes, but don't care about whether contents could be read/written. The tee-supplicant in these platform is limited to REE only, because there's an existing issue in Linux OS causing kernel drivers failed to support RPMB. So we need an option to prevent applications like xtest to access RPMB when calling ree_fs_open(), but keep the ability to call RPMB fs related apis. When we check the key thru RPMB read. If key is provisioned, tee-supplicant will return TEEC_ERROR_ITEM_NOT_FOUND. If not, optee-os will return TEE_ERROR_STORAGE_NOT_AVAILABLE. How-tested: execute xtest -t regression with optee-os CFG_REE_FS=y and CFG_RPMB_FS=y. optee-client RPMB_EMU=n Many testcases will fail. (ex: case 1004) Signed-off-by: Judy Wang <wangjudy@microsoft.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> | 3 年前 | |
optee/rpmb: rpmbfs support to read multi blocks To avoid crash caused by insufficient sharememory with rpmsgblk. Sharememory of specific product is 1024 which only enough to read one block, and ca_hello_world would read two blocks. So optee rpmb need to convert one read from multiple blocks to multiple reads. Signed-off-by: makejian <makejian@xiaomi.com> | 3 个月前 | |
core: make mobj_get_va() more secure Adds a length parameter to allow mobj_get_va() to check that the entire va range requested is available. Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> | 4 年前 | |
GP131: Update gpd.tee.trustedStorage.antiRollback.protectionLevel Updates used values for gpd.tee.trustedStorage.antiRollback.protectionLevel according to TEE Internal Core API version 1.3.1. Note that protection level 0 is not valid any longer, so report level 100 when RPMB isn't in use. Only root can tamper with the REE FS storage due to the REE file system permissions. Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> | 3 年前 | |
core: crypto: add support MD5 hashes in RSA sign/verify/cipher Introduce support of using MD5 hashes in RSA sign/verify/cipher operations, which is required by AOSP Keymaster. This is verified in VerificationOperationsTest.RsaSuccess VTS Test [1], which checks usage of such digests: NONE, MD5, SHA1, SHA_2_224, SHA_2_256, SHA_2_384, SHA_2_512. This patch has been inspired by commit[2]: Link: [1] https://android.googlesource.com/platform/hardware/interfaces/+/master/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp Link: [2] https://github.com/OP-TEE/optee_os/commit/199d0b7310d1705661a106358f1f0b46e4c5c587 ("core: crypto: add support MD5 hashes in RSA sign/verify") Signed-off-by: Julien Masson <jmasson@baylibre.com> Signed-off-by: Safae Ouajih <souajih@baylibre.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> | 3 年前 | |
optee/rpmb: The rpmb file storage path is compatible with miteefs Signed-off-by: makejian <makejian@xiaomi.com> | 3 个月前 | |
core: add framework to load REE-FS encrypted TAs Add framework to support loading of encrypted TAs from REE-FS using symmetric authenticated encryption scheme supported by OP-TEE. The default encryption key is derived from hardware unique key which can be overridden via platform specific encryption key. Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> | 6 年前 | |
Remove license notice from STMicroelectronics files Since a while the source files license info are defined by SPDX identifiers. We can safely remove the verbose license text from the files that are owned by either only STMicroelectronics or only both Linaro and STMicroelectronics. Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> | 8 年前 | |
Remove 'All rights reserved' from Linaro files The text 'All rights reserved' is useless [1]. The Free Software Foundation's REUSE Initiative best practices document [2] does not contain these words. Therefore, we can safely remove the text from the files that are owned by Linaro. Generated by: spdxify.py --linaro-only --strip-arr optee_os/ Link: [1] https://en.wikipedia.org/wiki/All_rights_reserved Link: [2] https://reuse.software/practices/ Link: [3] https://github.com/jforissier/misc/blob/f7b56c8/spdxify.py Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org> | 8 年前 |