Skip to content

Commit

Permalink
fix comments by Etienne OP-TEE#3
Browse files Browse the repository at this point in the history
Check only for (src|dst, sz) in tests/invoke.c

Signed-off-by: Anton Rybakov <[email protected]>
  • Loading branch information
a-rybakov committed Jun 3, 2021
1 parent f41a30a commit 5c77d9e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions core/pta/tests/invoke.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,7 @@ static TEE_Result test_inject_sdp(uint32_t type, TEE_Param p[TEE_NUM_PARAMS])
return TEE_SUCCESS;

/* Check that core can p2v and v2p over memory reference arguments */
if (test_v2p2v(src, sz) || test_v2p2v(src + sz - 1, 1) ||
test_v2p2v(dst, sz) || test_v2p2v(dst + sz - 1, 1))
if (test_v2p2v(src, sz) || test_v2p2v(dst, sz))
return TEE_ERROR_SECURITY;

if (cache_operation(TEE_CACHEFLUSH, dst, sz) != TEE_SUCCESS)
Expand Down Expand Up @@ -315,7 +314,7 @@ static TEE_Result test_transform_sdp(uint32_t type, TEE_Param p[TEE_NUM_PARAMS])
return TEE_SUCCESS;

/* Check that core can p2v and v2p over memory reference arguments */
if (test_v2p2v(buf, sz) || test_v2p2v(buf + sz - 1, 0))
if (test_v2p2v(buf, sz))
return TEE_ERROR_SECURITY;

if (cache_operation(TEE_CACHEFLUSH, buf, sz) != TEE_SUCCESS)
Expand Down Expand Up @@ -360,8 +359,7 @@ static TEE_Result test_dump_sdp(uint32_t type, TEE_Param p[TEE_NUM_PARAMS])
return TEE_SUCCESS;

/* Check that core can p2v and v2p over memory reference arguments */
if (test_v2p2v(src, sz) || test_v2p2v(src + sz - 1, 0) ||
test_v2p2v(dst, sz) || test_v2p2v(dst + sz - 1, 0))
if (test_v2p2v(src, sz) || test_v2p2v(dst, sz))
return TEE_ERROR_SECURITY;

if (cache_operation(TEE_CACHEFLUSH, dst, sz) != TEE_SUCCESS)
Expand Down

0 comments on commit 5c77d9e

Please sign in to comment.