Skip to content

Commit

Permalink
secstor: fix memory leak in install_ta()
Browse files Browse the repository at this point in the history
If signature check failed, we need to close tadb session first.

Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
  • Loading branch information
lorc authored and jforissier committed Jan 24, 2018
1 parent e9596d0 commit c10e9d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/arch/arm/pta/secstor_ta_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ static TEE_Result install_ta(struct shdr *shdr, const uint8_t *nw,

res = crypto_hash_final(hash_ctx, hash_algo, buf, shdr->hash_size);
if (res)
goto err_free_hash_ctx;
goto err_ta_finalize;
if (buf_compare_ct(buf, SHDR_GET_HASH(shdr), shdr->hash_size)) {
res = TEE_ERROR_SECURITY;
goto err_free_hash_ctx;
goto err_ta_finalize;
}

crypto_hash_free_ctx(hash_ctx, hash_algo);
Expand Down

0 comments on commit c10e9d4

Please sign in to comment.