Skip to content

Commit d7f0164

Browse files
jiajiehoherbertx
authored andcommitted
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]>
1 parent 25ca4a8 commit d7f0164

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
@@ -276,7 +276,6 @@ static int starfive_rsa_enc_core(struct starfive_cryp_ctx *ctx, int enc)
276276

277277
err_rsa_crypt:
278278
writel(STARFIVE_RSA_RESET, cryp->base + STARFIVE_PKA_CACR_OFFSET);
279-
kfree(rctx->rsa_data);
280279
return ret;
281280
}
282281

0 commit comments

Comments
 (0)