lkml.org 
[lkml]   [2021]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 1/7] crypto: fix a memory leak in sm2
From
Date
Hi Herbert, Hongbo,

On 5/27/21 9:53 PM, Hongbo Li wrote:
> From: Hongbo Li <herberthbli@tencent.com>
>
> SM2 module alloc ec->Q in sm2_set_pub_key(), when doing alg test in
> test_akcipher_one(), it will set public key for every test vector,
> and don't free ec->Q. This will cause a memory leak.
>
> This patch alloc ec->Q in sm2_ec_ctx_init().
>
> Fixes: ea7ecb66440b ("crypto: sm2 - introduce OSCCA SM2 asymmetric cipher algorithm")
> Signed-off-by: Hongbo Li <herberthbli@tencent.com>
> Reviewed-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
> ---
> crypto/sm2.c | 24 ++++++++++--------------
> 1 file changed, 10 insertions(+), 14 deletions(-)
>

Patch 1/7 is an independent bugfix patch. If possible, consider applying
it first.

The commit message header should start with: crypto: sm2 -

Also added:

Cc: stable@vger.kernel.org # v5.10+

Best regards,
Tianjia

\
 
 \ /
  Last update: 2021-05-28 08:27    [W:0.067 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site