Commit 293edc27 authored by Gilad Ben-Yossef's avatar Gilad Ben-Yossef Committed by Greg Kroah-Hartman

stating: ccree: revert "staging: ccree: fix leak of import() after init()"

This reverts commit c5f39d07 ("staging: ccree: fix leak of import()
after init()") and commit aece0902 ("staging: ccree: Uninitialized
return in ssi_ahash_import()").

This is the wrong solution and ends up relying on uninitialized memory,
although it was not obvious to me at the time.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarGilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7345b14d
...@@ -1673,7 +1673,7 @@ static int cc_hash_import(struct ahash_request *req, const void *in) ...@@ -1673,7 +1673,7 @@ static int cc_hash_import(struct ahash_request *req, const void *in)
struct device *dev = drvdata_to_dev(ctx->drvdata); struct device *dev = drvdata_to_dev(ctx->drvdata);
struct ahash_req_ctx *state = ahash_request_ctx(req); struct ahash_req_ctx *state = ahash_request_ctx(req);
u32 tmp; u32 tmp;
int rc = 0; int rc;
memcpy(&tmp, in, sizeof(u32)); memcpy(&tmp, in, sizeof(u32));
if (tmp != CC_EXPORT_MAGIC) { if (tmp != CC_EXPORT_MAGIC) {
...@@ -1682,12 +1682,9 @@ static int cc_hash_import(struct ahash_request *req, const void *in) ...@@ -1682,12 +1682,9 @@ static int cc_hash_import(struct ahash_request *req, const void *in)
} }
in += sizeof(u32); in += sizeof(u32);
/* call init() to allocate bufs if the user hasn't */ rc = cc_hash_init(req);
if (!state->digest_buff) { if (rc)
rc = cc_hash_init(req); goto out;
if (rc)
goto out;
}
dma_sync_single_for_cpu(dev, state->digest_buff_dma_addr, dma_sync_single_for_cpu(dev, state->digest_buff_dma_addr,
ctx->inter_digestsize, DMA_BIDIRECTIONAL); ctx->inter_digestsize, DMA_BIDIRECTIONAL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment