这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@jforissier
Copy link
Contributor

Parse CFG_TEE_CLIENT_LOAD_PATH (TEEC_LOAD_PATH) and TEEC_TEST_LOAD_PATH
as a colon-separated list of paths. This commit also updates the
documentation of CFG_TEE_CLIENT_LOAD_PATH and try_load_secure_module()
which were either lacking or incorrect.

Suggested-by: Chao Chen ccha@amazon.com
Signed-off-by: Jerome Forissier jerome.forissier@linaro.org

if (!ta_path_str)
goto err;

for (p = ta_path_str; *p; p++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this can be simplified with strtok_r().
strtok_r() is destructive so we'd need to copy path to ta_path_str again before the second loop.

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a minor comment. @jforissier, my R-b tag unless you change the implementation as per @jenswi-linaro suggestion.

* filesystem and return it back to the caller in the parameter ta.
*
* @prefix, @dev_path Where to load the TA from. The full path to the TA
* binary is @prefix/@dev_path/@destination.ta.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for consistency:

  * @param: prefix       Prefix for TA load path
  * @param: dev_path     Where to load the TA from. The full path to the TA
  *                      binary is @prefix/@dev_path/@destination.ta.

@jforissier
Copy link
Contributor Author

Comments addressed.

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>

}
n++; /* NULL terminator */

ta_path = malloc(n * sizeof(char *));
Copy link
Contributor

@jenswi-linaro jenswi-linaro Jun 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last element in the array should be zeroed, perhaps calloc() here instead would be a better choice.

Edit: nevermind, I see that it indeed is zeroed when the loop is terminated below.

Copy link
Contributor

@etienne-lms etienne-lms Jun 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also though it should but since line 730 breaks when ta_path[n++] is NULL, last element is properly inited to NULL, IIUC.

(edited):

Edit: nevermind, I see that it indeed is zeroed when the loop is terminated below.

Indeed. I've should have read your updated comment :)

@jenswi-linaro
Copy link
Contributor

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

Parse CFG_TEE_CLIENT_LOAD_PATH (TEEC_LOAD_PATH) and TEEC_TEST_LOAD_PATH
as a colon-separated list of paths. This commit also updates the
documentation of CFG_TEE_CLIENT_LOAD_PATH and try_load_secure_module()
which were either lacking or incorrect.

Suggested-by: Chao Chen <ccha@amazon.com>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
@jforissier jforissier merged commit f7ed8e3 into OP-TEE:master Jun 29, 2022
@jforissier jforissier deleted the mpath branch June 29, 2022 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants