Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5635113ybe; Tue, 17 Sep 2019 11:03:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjAR7kZQEHX46KZTdQCCTw07U3RdR2YWi1SCq9FPP0OphJTIzmzF9DTAMTDhFP8AuhdFh0 X-Received: by 2002:aa7:d40d:: with SMTP id z13mr5899265edq.229.1568743399204; Tue, 17 Sep 2019 11:03:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568743399; cv=none; d=google.com; s=arc-20160816; b=yUbCZ3MBnuOjamf3yqEq0zkaxK5/TdhRqnavi2pR8NIs8shJYycFZArIdP5ThSj3pe jMs/6Re3p/Tu71YpTM7ngI9yhHonlgFlKso+ItoD5Vgz1iBw/qtdgBOqJimXQ9TiZRPS nPEu3h2k8ps3PuNdeM+bpwjyrVJpkiKWui0CloCoL09Knnv8RJxxPOXYGHlVquVyCRBg 6jbLsgBPO2AivgC+XoeaFc4Vth+web9Ej1ThcXANdbOMUhAMyF8jd4PSAW+HHuuAvPfu J0QCvQsuFdCinOoiCMkW/PqnG+qd5Fsi8OwyRpqb/Fb3zZ1UEPyjZHU7+OnamRRAMCF9 hWLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=tQQp13k3EPZU/wQRUS1gPNy7Bf9APvYiy3WR/vi796w=; b=dG8uIhQ4oHSMSZ2OwRBdQzAtc56uF5TSqsZ18kRivkXGxjXiVoDaFOcaxLpHytOxVN syXPpwME7cheiBFY5O9iu4yoNWwzpPrRJcSryTwE9oXcaiUdxAaLVy2iVpETaKlxvEEC 65Az2re2mTIqqLRp6g4Tra4IItlJxNyJ04s2lP3OLyOPbz5WFh7otiPOjLBqN4TB3N5J 8Rv3ONqUkJ18avPwmGLMn1Jb4/MkKQE/D1B5vqiZFSnRHnR1EUhEb0Ft94WK8xjSRg4u BES9pJQP9fnjoJ+xKExIRqIpZ5DbhQ7pIU1ER5OleQUb9tyHWuNZ1ypSj+xclQnd4e8N Ngbw== 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 a7si1415931ejx.258.2019.09.17.11.02.55; Tue, 17 Sep 2019 11:03:19 -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 S1728649AbfIQOrt (ORCPT + 99 others); Tue, 17 Sep 2019 10:47:49 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2669 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727708AbfIQOrs (ORCPT ); Tue, 17 Sep 2019 10:47:48 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 02CCF7BD55C2B671137A; Tue, 17 Sep 2019 22:47:41 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Tue, 17 Sep 2019 22:47:31 +0800 From: zhong jiang To: , CC: , , , , Subject: [RESENT PATCH v2] ixgbe: Use memzero_explicit directly in crypto cases Date: Tue, 17 Sep 2019 22:44:22 +0800 Message-ID: <1568731462-46758-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's better to use memzero_explicit() to replace memset() in crypto cases. Signed-off-by: zhong jiang --- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 1.7.12.4