Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp339354rwe; Wed, 24 Aug 2022 01:45:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR5hspwUb/yVzd5Z8Z3yc/QvTv3e5khGHe6ZtQpzWM3uLdqgIKUlSP5qAPj2e2efxD6Olqxc X-Received: by 2002:a17:907:270e:b0:73c:b0fd:f9a2 with SMTP id w14-20020a170907270e00b0073cb0fdf9a2mr2177390ejk.411.1661330715529; Wed, 24 Aug 2022 01:45:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661330715; cv=none; d=google.com; s=arc-20160816; b=nq1bEvkNLFV58oREtbz3WoEg0UgT4NbTViLzFGcXKesou4crefQ215jRtHRF4dDinW HGj2X0sWVBj2vJEFHWKpxEIJR7obUew0B7fUneaysFa8Xes8jlXzNt6rv6moa5OSs2Eo j0V3iycLtmaM5L6rqfCXNe+isdLbBHQ+W0oQ2bNVnnv1NkptYu75Qdu7j0YZkpVnZTLg LIDhmzG1zloOcsHhXGn3IqsG7655ZBN+GYUe9CN/K2M2o4OYn3bSxKqOnM8a9xCHfJHb aud2SysoNFHp7/RyD6tticCpCMNd1Q2iulxZnLrQ7Hw5MpUbZE95Lp/K5X9sSyHaAWul o7Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:subject:cc:user-agent:mime-version:date:message-id :dkim-signature; bh=+N+UE2X7qHP/k3D28KNJuWxXPnW1fj++zF37MMUkZvs=; b=fbQE5cAbbERQCh5+6JtTebg2VznFNzQXO65a6GldfwaI8i74z1iygvVIRoKR7jhumI 1Mnfqvl0rg1BeNTAqLQqhIJgPAEg4ud5r60NRAb1aeWAAiWq7Yiorhx5il5jz73pPZQ1 CV+5Z6xkZYiZTqBsd4sYYBu/DsbvjkMN/fE4XfC3uhfllbMvuB366LNxoPUUG7ubXCa/ 8s+1GEbWjc95+ENdeOMvTEkN+/+iKkr6uk5F/oDKjVbKK7z2TjfX9PAhGDQ3SJQUb3u5 h1KWxvdY3EebwHThCwItm5zejMcCqNbJDApqhjnuM6qUY6wasfV2rRnOQtxEOq2SMubt vneA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=l2mLLuW9; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs9-20020a1709072d0900b0073da7f87a09si1810974ejc.585.2022.08.24.01.44.21; Wed, 24 Aug 2022 01:45:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=l2mLLuW9; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235184AbiHXIiK (ORCPT + 99 others); Wed, 24 Aug 2022 04:38:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235056AbiHXIiI (ORCPT ); Wed, 24 Aug 2022 04:38:08 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09E8869F4A for ; Wed, 24 Aug 2022 01:38:07 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id r15-20020a17090a1bcf00b001fabf42a11cso821441pjr.3 for ; Wed, 24 Aug 2022 01:38:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to:subject:cc :user-agent:mime-version:date:message-id:from:to:cc; bh=+N+UE2X7qHP/k3D28KNJuWxXPnW1fj++zF37MMUkZvs=; b=l2mLLuW96AUMrOkw1NO9NyPlFA+5vidq2XHQ1XGYHXAt58pkEkSdmTrVB0bq+Ij/Dd NFPq5Cq03M7jUOl1bFfiHiNld5AxAk4ZmpQne5kyZRDzmeoODLxiYLskI1xUM3NFwrpC LvtoN33HZeFUOKjFrOmeNvlTVuG0HLWbjBnip//tNSPxhZWyC7fYydTJ2bfH1WCXRii4 dz/xsMiJr7y/pEWxjKOuNiFVwOtVe7tyS+HkhpGhwzvj57iP6pT7n68x5VmhGp+EZvDn bk2xuQN/peZCsxoaMfNN/MChuqiB6M+yXj+4NGzNnLTWFIVoQHOpHTY3HVyQ4X+jecC5 om1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to:subject:cc :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc; bh=+N+UE2X7qHP/k3D28KNJuWxXPnW1fj++zF37MMUkZvs=; b=w0JGwQrAbPPb53O5RXrWfKSwZifNnruJ40DAceGi4w3fggq0TsZmkDwvovxruk6bLH yxQqGBMWD/JaJ8IB/seTfSRnNd7buSPDoTgAWCOVW0SGn4jE54kaBhPx0f2dvDSwUMV7 2cFjQM8ueM7XLzwYpUzFrnbk/FP/YxMnLA3V0F40nvYqcMCf6Ln1ALmEEQmWqjx4mkhW hncPE5TeynuL1qxQ+EAsJoKJ2TYKRSuPCSk6Yhw9hATR8WqNdN2vl+2qtvS5dK8DlZxC VkzXadk67xHOnYZ5RoexvyH10d01XViz8dvJU+XKWi+DmDh0GOirwZ1ijWN6i/aJRvWn /4+g== X-Gm-Message-State: ACgBeo25QGrxpUMrSuNztXeko8m/bTdzK5NEVJHakKnMLIJFLRykUHoc nxmOV4oDw3INz2uHDZChplsntw== X-Received: by 2002:a17:902:aa03:b0:172:9b18:ebb1 with SMTP id be3-20020a170902aa0300b001729b18ebb1mr26730429plb.24.1661330286451; Wed, 24 Aug 2022 01:38:06 -0700 (PDT) Received: from [10.76.43.148] ([61.120.150.76]) by smtp.gmail.com with ESMTPSA id lp12-20020a17090b4a8c00b001fa8b909ef0sm843210pjb.7.2022.08.24.01.38.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Aug 2022 01:38:06 -0700 (PDT) Message-ID: <95f6eec3-62f7-46d8-9bb1-664fb9e36534@bytedance.com> Date: Wed, 24 Aug 2022 16:38:00 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Cc: helei.sig11@bytedance.com, virtualization@lists.linux-foundation.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, pizhenwei@bytedance.com Subject: PING: [PATCH v2] virtio-crypto: fix memory-leak To: mst@redhat.com, herbert@gondor.apana.org.au, arei.gonglei@huawei.com References: <20220816094336.27806-1-helei.sig11@bytedance.com> From: Lei He In-Reply-To: <20220816094336.27806-1-helei.sig11@bytedance.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 2022/8/16 下午5:43, Lei He wrote: > From: lei he > > Fix memory-leak for virtio-crypto akcipher request, this problem is > introduced by 59ca6c93387d3(virtio-crypto: implement RSA algorithm). > The leak can be reproduced and tested with the following script > inside virtual machine: > > Signed-off-by: lei he > Acked-by: Michael S. Tsirkin > Reviewed-by: Gonglei > --- > drivers/crypto/virtio/virtio_crypto_akcipher_algs.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c > index 2a60d0525cde..168195672e2e 100644 > --- a/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c > +++ b/drivers/crypto/virtio/virtio_crypto_akcipher_algs.c > @@ -56,6 +56,10 @@ static void virtio_crypto_akcipher_finalize_req( > struct virtio_crypto_akcipher_request *vc_akcipher_req, > struct akcipher_request *req, int err) > { > + kfree(vc_akcipher_req->src_buf); > + kfree(vc_akcipher_req->dst_buf); > + vc_akcipher_req->src_buf = NULL; > + vc_akcipher_req->dst_buf = NULL; > virtcrypto_clear_request(&vc_akcipher_req->base); > > crypto_finalize_akcipher_request(vc_akcipher_req->base.dataq->engine, req, err); > > base-commit: 568035b01cfb107af8d2e4bd2fb9aea22cf5b868 PING. Best regards, Lei He -- helei.sig11@bytedance.com