Re: [PATCH] crypto: lib/mpi - Fix unexpected pointer access

From: Herbert Xu
Date: Thu Dec 21 2023 - 23:37:14 EST


On Thu, Dec 14, 2023 at 11:08:34AM +0800, Tianjia Zhang wrote:
> When the mpi_ec_ctx structure is initialized, some fields are not
> cleared, causing a crash when referencing the field when the
> structure was released. Initially, this issue was ignored because
> memory for mpi_ec_ctx is allocated with the __GFP_ZERO flag.
> For example, this error will be triggered when calculating the
> Za value for SM2 separately.
>
> Fixes: d58bb7e55a8a ("lib/mpi: Introduce ec implementation to MPI library")
> Cc: stable@xxxxxxxxxxxxxxx # v6.5
> Signed-off-by: Tianjia Zhang <tianjia.zhang@xxxxxxxxxxxxxxxxx>
> ---
> lib/crypto/mpi/ec.c | 3 +++
> 1 file changed, 3 insertions(+)

Patch applied. Thanks.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt