Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5736727ybe; Tue, 17 Sep 2019 12:38:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3sSU8pDR+oPMIeIf6FrYfJLQKdy4uhXz96sGdiqJT+2Sc6YujUrNzqW4O7q0QzxKKyozc X-Received: by 2002:a50:b885:: with SMTP id l5mr6324503ede.190.1568749115318; Tue, 17 Sep 2019 12:38:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568749115; cv=none; d=google.com; s=arc-20160816; b=vyIT2eoL2o5A0jY3/cl9qQdOkqjup8A7y/oUIjghwOr6Ufs8EDo6RV6qRjcrnU/Gyl VX3SPKa+iQ0u5rjTBrfu6fmu4HLby5fPUvlRLPqp4UL3f8vdDxwVIt0t7zExBKhP9uIx ezLH8ffIALljTp7L3OoMo5lQwSuE8PcefQzoCKR4bRUajEL2vlH7IRmw7JaIr2HbK3Nb mmp37xdZC2qhqN4pITWXcIdNAKwSdsBX1CpNHddFBbKEUxWs+xXbVytfC7/SlbqVVMvo CMWryjX+/V0EQn4s9AjsWYS0h0HY96KQgolPafmWNiPZ88E9Zgi5odGWDGS1XrmaMzON Jefg== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=7eMuc3DFVGqc5wIBgnpyU0/P0KHdVF14u6P2PX1Ul64=; b=qpxUQlnAvqaXEdWADHzr0JQxlv8fn3C/1Iywk3Y+JF/CcwfjxXlK/+XYC5wm/h6lhe wFkV4SSX+GJ6e/PS1KJA4SM8RNL9sDeSd30/28uk557xduRg3NiINxA3qgINyQ3Gi1Ip Txo0isfu735y2u6uyy6T9eM1OTtGrK9yW01kkGNeD4RBNQgZvh4nz4PY1bzfSr++FBxW qZBUheD7QSh3/P5rj9mCvLkk2pxpmaTxrozB8VWqWCzbX8+w86iBNDvpR1jRcmjX9gUW nVxbhvGZmzW6vbNWeGfjELJtL8x7VxLb/6jq2XOj9qhKQB41Wr6BLnKA/6Fp/fZzn8Q1 Ilrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=z5+Ft6n6; 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 n19si1889287edo.172.2019.09.17.12.38.11; Tue, 17 Sep 2019 12:38:35 -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; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=z5+Ft6n6; 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 S1728284AbfIQSLL (ORCPT + 99 others); Tue, 17 Sep 2019 14:11:11 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:46656 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726883AbfIQSLL (ORCPT ); Tue, 17 Sep 2019 14:11:11 -0400 Received: by mail-pg1-f194.google.com with SMTP id a3so2404299pgm.13 for ; Tue, 17 Sep 2019 11:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=7eMuc3DFVGqc5wIBgnpyU0/P0KHdVF14u6P2PX1Ul64=; b=z5+Ft6n6ABuSaQkYPk7fZaV68A9BmoGF503VR9JiuGmhx5TT61pkYojxRyTHyXgAIK AEsMeti3pBVoHG4tzft71gWPQBd8ooS3L1ilWbwI9fkSGcMhG19Zb8YnuJSRw1K/wCCm EXol5FElqpiq+e1/qBfn3BEcqRpQPzmoUvzdylVLNi6cFLt3T4N5DEEnmfT6oF8NUHUa UE52pbJWiQ+YHVIQwIlQe0/MBiUqsB5zlTR6AZCCatfWesGD6zLuz+HcIvpbAI8h4lfd +4+IJ9oErbrEt4VP0tzPnaamIU3VPjv87amm5IXs/fEj7Xnv7vOj9nIZai1j0rBsnacZ FANA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=7eMuc3DFVGqc5wIBgnpyU0/P0KHdVF14u6P2PX1Ul64=; b=kL09LNXWrZaXjjFHzLaJUNR41B5NdV7GZrj6z1dzDgNy2zKcIRuhfzfJLWbS6tgo1i jungE1itkKmPXhoM51RuSPXJjukiEKJbGx0q1o1MQUH31WUhYfFyJE8trHqjPtfAWN+9 lYG3sMt4IlknA9SdTv2bFK7+GIDej3Neoc2faoNeERfL+ldqttwF2DNlF7Ciy6Qt6alf V9ku8NW1owlOf39kof0cY36A8YpCekGbMd7SDoOMjRKxS0KTczn4imaOXIKJUlEE5GlB +/kW0N2A/Ld9LUk57rQl8dWiMN2yKVxps/2NNRPmSKoer59P3wxLztr/En+6lDJUED4L V3AA== X-Gm-Message-State: APjAAAW+m63lx7svT3ryyOyQKSP6xoTZY0iJ68k5Cl3tDxb3b1iVTIOH daYyI737GR+hrHj+1wowuYQWsA== X-Received: by 2002:a62:7c14:: with SMTP id x20mr5724989pfc.228.1568743870494; Tue, 17 Sep 2019 11:11:10 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id i16sm1339960pfa.184.2019.09.17.11.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 11:11:10 -0700 (PDT) Date: Tue, 17 Sep 2019 11:11:07 -0700 From: Jakub Kicinski To: zhong jiang Cc: , , , , Subject: Re: [RESENT PATCH v2] ixgbe: Use memzero_explicit directly in crypto cases Message-ID: <20190917111107.307295c6@cakuba.netronome.com> In-Reply-To: <1568731462-46758-1-git-send-email-zhongjiang@huawei.com> References: <1568731462-46758-1-git-send-email-zhongjiang@huawei.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > 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;