Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6078862ybe; Tue, 17 Sep 2019 19:42:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqwF0EKLsGVdmvUr43LVyBVGHn+Nkitvlp9weeS10D1/llkHIVUdwRj2hdM0kjnu97E275p8 X-Received: by 2002:a17:906:5915:: with SMTP id h21mr7417129ejq.28.1568774578753; Tue, 17 Sep 2019 19:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568774578; cv=none; d=google.com; s=arc-20160816; b=DjswmVJDFUMIjWu9vyFDnmsJZF5Hz1AglX+1WQHkqlBisIorcJWzzKtbIbVUnui+p6 BsR/RCtF23U+rxpHXwljjqL244N0UCNRiH7K3SBpjhDGIAgRi+AauEedJs+4uXS5ol+v flzpLhCKm+cfVKg0VfCM2rkm26HFAftOMETDkMA3aDNRXFYEJxbtfC4gfwysUj90td8Y yOQsVcX9lb8vmrQo1YhUSiOQ/p4UIGfUn0ail0AuoM97dRypqOLU1qndq74UbdrpCvVf XFDfSpkiNHme6wyul6etREv8m6Peq6z0s5fv//7hSw856vFimIwMZHK3fzXfHSsxOC8Q SFpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=9IiNcRl3LW8LISATgTqTQsdi3PkvbPIB/2k9NkcQFUY=; b=MwK7UeKO9drqI0FDneix+Myqj+7WaVRCNMF3QgYkEa4/OGY/eV2j2u4RXbQmMv/Pjh E2jDhqMX4+jj6QRw3/Ufavq6FyHrRgT6pE09kzE5pxRxPiy9toGDYq1JodeCZaaiHsb+ XVg8pqTFJOYMu+JVRp3Bd6/cueN9dkRyb6n+9IT5qiP3QEjtBgXGXOtIaM+36D9qnJvA 8KTvHoHrIHhENgSKk5ciqP23s6R1scJdeekOsjMWEKoKEDjOB1WuGQG4bf5Xtj9m6OHg UPeStdJxMqwby/+eYs9ACAuipy7LcmuAOA6OX8B1TlOrOBN39SkW1N9oTgF3TNZ2Puk/ hlkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e12si2620565edb.262.2019.09.17.19.42.35; Tue, 17 Sep 2019 19:42:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728713AbfIRBfF (ORCPT + 99 others); Tue, 17 Sep 2019 21:35:05 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2289 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726829AbfIRBfE (ORCPT ); Tue, 17 Sep 2019 21:35:04 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 8C5E06666C79ED21B93B; Wed, 18 Sep 2019 09:35:02 +0800 (CST) Received: from [127.0.0.1] (10.177.29.68) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Wed, 18 Sep 2019 09:34:57 +0800 Message-ID: <5D8189C0.3070107@huawei.com> Date: Wed, 18 Sep 2019 09:34:56 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Jakub Kicinski CC: , , , , Subject: Re: [RESENT PATCH v2] ixgbe: Use memzero_explicit directly in crypto cases References: <1568731462-46758-1-git-send-email-zhongjiang@huawei.com> <20190917111107.307295c6@cakuba.netronome.com> In-Reply-To: <20190917111107.307295c6@cakuba.netronome.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/9/18 2:11, Jakub Kicinski wrote: > On Tue, 17 Sep 2019 22:44:22 +0800, zhong jiang wrote: >> It's better to use memzero_explicit() to replace memset() in crypto cases. >> >> Signed-off-by: zhong jiang > Thank you for the follow up! Your previous patch to use kzfree() > has been applied on its own merit, could you rebase this one on top > of current net-next/master? I will do that. Thanks, zhong jiang >> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c >> index 31629fc..7e4f32f 100644 >> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c >> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c >> @@ -960,10 +960,10 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) >> return 0; >> >> err_aead: >> - memset(xs->aead, 0, sizeof(*xs->aead)); >> + memzero_explicit(xs->aead, sizeof(*xs->aead)); >> kfree(xs->aead); >> err_xs: >> - memset(xs, 0, sizeof(*xs)); >> + memzero_explicit(xs, sizeof(*xs)); >> kfree(xs); >> err_out: >> msgbuf[1] = err; >> @@ -1049,7 +1049,7 @@ int ixgbe_ipsec_vf_del_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) >> ixgbe_ipsec_del_sa(xs); >> >> /* remove the xs that was made-up in the add request */ >> - memset(xs, 0, sizeof(*xs)); >> + memzero_explicit(xs, sizeof(*xs)); >> kfree(xs); >> >> return 0; > > . >