aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJia Jie Ho <[email protected]>2024-04-29 14:06:39 +0800
committerHerbert Xu <[email protected]>2024-05-10 17:15:24 +0800
commitd7f01649f4eaf1878472d3d3f480ae1e50d98f6c (patch)
tree739e00104ba705b78b010663ede243f4b8c90ce8
parent25ca4a85e943d73582f3e576f0f829329568d0a3 (diff)
crypto: starfive - Do not free stack buffer
RSA text data uses variable length buffer allocated in software stack. Calling kfree on it causes undefined behaviour in subsequent operations. Cc: <[email protected]> #6.7+ Signed-off-by: Jia Jie Ho <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
-rw-r--r--drivers/crypto/starfive/jh7110-rsa.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/crypto/starfive/jh7110-rsa.c b/drivers/crypto/starfive/jh7110-rsa.c
index 4d7eb3d1e764..33093ba4b13a 100644
--- a/drivers/crypto/starfive/jh7110-rsa.c
+++ b/drivers/crypto/starfive/jh7110-rsa.c
@@ -276,7 +276,6 @@ static int starfive_rsa_enc_core(struct starfive_cryp_ctx *ctx, int enc)
err_rsa_crypt:
writel(STARFIVE_RSA_RESET, cryp->base + STARFIVE_PKA_CACR_OFFSET);
- kfree(rctx->rsa_data);
return ret;
}