Skip to content

Commit 5944de1

Browse files
jiajiehogregkh
authored andcommitted
crypto: starfive - Do not free stack buffer
commit d7f0164 upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0c31344 commit 5944de1

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/crypto/starfive/jh7110-rsa.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ static int starfive_rsa_enc_core(struct starfive_cryp_ctx *ctx, int enc)
273273

274274
err_rsa_crypt:
275275
writel(STARFIVE_RSA_RESET, cryp->base + STARFIVE_PKA_CACR_OFFSET);
276-
kfree(rctx->rsa_data);
277276
return ret;
278277
}
279278

0 commit comments

Comments
 (0)