Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3607757iob; Sat, 7 May 2022 09:34:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4NKxkAWGg2i3+W34y4pP9R8kDUN13Gvhe2p2lSihFTUwPDyvdWpKA5zg5xZjnG2o1TgEb X-Received: by 2002:a05:6402:28b1:b0:425:c39e:b773 with SMTP id eg49-20020a05640228b100b00425c39eb773mr9063096edb.237.1651941263676; Sat, 07 May 2022 09:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651941263; cv=none; d=google.com; s=arc-20160816; b=P4mdsNqjLT+3C91gx1OQ0l7Nv2nBxWV3lKEsXcdSzqwXnXfG1fr0Yv7okl6yfxOUWU SZ62BsfWAObWQRbV9ib2lVS2IFJ/rgedLz6lSYApgj9KPaZ61qWD6nIV/Wv322r/vir2 V+2KX1DhOWiRp0OOFi6lIm/mvOvuKUp1y1O6nA4vVoV9fQVt3ro1NW+2mflrlnDIipDj TvoPkPcBsZ7jcd2rOrOmPi7zQmb8cBitKHgc9N+ELTyNTUHDCKeJULMUXxUXH2VPc+y3 EBpxMwLY6XVjWygP2/+jtkJBnnNnkFLaZh9QVr04+qAd3svzwIYSGo/OFQShUJcjxvAR uuMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RhJTHzxFMPDAuJHsdhW8pf38kiCRf0yzovVas/cVvtw=; b=YeNyno2xF0TP4OBjg7VEuPcS0zhRciYyvNDDTEHfvKPfYFNaU7KiS4j+wUAf8cGb5K rGj+r6nkUuYrmnOG5rwQuSskRNpLvxcsiNC9wbVsHbNpCsTEgB4sHC7yXQszkVotqvFG 0GB6zjcq4mhtnYsnIeispkkIHFa7jIWTHTlVcJoc/pSEyp5Qj3U61WIAPzWYzquzc+pT v6H9l6nN+Zqn8BKcfHPtyiWL8O+ulir/FiGW6zOoaGvlsPBywfqWB88YeiQ9U+ugjJU0 IyFNJxwF8QHgts30We/p5gFOqhFBaxeXuzHFUXex4QjXuZqF2YIp4ZXFhl9raJeBg3jC 5TOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g3adhw+c; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb12-20020a1709076d8c00b006f3891ead87si7893238ejc.802.2022.05.07.09.33.39; Sat, 07 May 2022 09:34:23 -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=@linuxfoundation.org header.s=korg header.b=g3adhw+c; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237778AbiEFJ1n (ORCPT + 99 others); Fri, 6 May 2022 05:27:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344584AbiEFJ1m (ORCPT ); Fri, 6 May 2022 05:27:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEA9764BE7; Fri, 6 May 2022 02:23:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 76279B834B1; Fri, 6 May 2022 09:23:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2917C385AA; Fri, 6 May 2022 09:23:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651829037; bh=emgkTRX8avRNxyVSyZGlhR7HqlUX5lEQ6X8egOHIG3M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g3adhw+cFQi+x+2/Vz8x+XMy/zRdkOQ9NSMLg/aAo+3Tv0C7JEtm8ZYt+tGlLfgkT /Pc31Xv0PiNtif5Uk/FCuxDrNoLw4bexKJwpanQxObc71a+Y1+WBXkXojg3CC3Es+S D6Dr8l1bOTP4jlwxxmOTnTmCixhM4EIMps9zSR1w= Date: Fri, 6 May 2022 11:23:50 +0200 From: Greg KH To: Giovanni Cabiddu Cc: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org, qat-linux@intel.com, vdronov@redhat.com, stable@vger.kernel.org, Adam Guerin , Wojciech Ziemba Subject: Re: [PATCH 07/12] crypto: qat - set to zero DH parameters before free Message-ID: References: <20220506082327.21605-1-giovanni.cabiddu@intel.com> <20220506082327.21605-8-giovanni.cabiddu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220506082327.21605-8-giovanni.cabiddu@intel.com> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Fri, May 06, 2022 at 09:23:22AM +0100, Giovanni Cabiddu wrote: > Set to zero the DH context buffers containing the DH key before they are > freed. That says what, but not why. > Cc: stable@vger.kernel.org > Fixes: c9839143ebbf ("crypto: qat - Add DH support") > Signed-off-by: Giovanni Cabiddu > Reviewed-by: Adam Guerin > Reviewed-by: Wojciech Ziemba > --- > drivers/crypto/qat/qat_common/qat_asym_algs.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/crypto/qat/qat_common/qat_asym_algs.c b/drivers/crypto/qat/qat_common/qat_asym_algs.c > index d75eb77c9fb9..2fec89b8a188 100644 > --- a/drivers/crypto/qat/qat_common/qat_asym_algs.c > +++ b/drivers/crypto/qat/qat_common/qat_asym_algs.c > @@ -421,14 +421,17 @@ static int qat_dh_set_params(struct qat_dh_ctx *ctx, struct dh *params) > static void qat_dh_clear_ctx(struct device *dev, struct qat_dh_ctx *ctx) > { > if (ctx->g) { > + memzero_explicit(ctx->g, ctx->p_size); > dma_free_coherent(dev, ctx->p_size, ctx->g, ctx->dma_g); Why is a memset() not sufficient here? And what is this solving? Who would get this stale data? thanks, greg k-h