Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9616653ybi; Wed, 10 Jul 2019 13:35:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrW4D0XSHnSmbFombmFAfTqyAvdfc0FsCMq9pT4Qw41wBCg334vC+cuoq6mzhw9wdoakbz X-Received: by 2002:a63:dc50:: with SMTP id f16mr110388pgj.447.1562790907883; Wed, 10 Jul 2019 13:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562790907; cv=none; d=google.com; s=arc-20160816; b=JpQjBEHRedndzUE3+aehqkmmpXQaFI9pPlub9k/in0j22aL7nRD3dRISAhhBBEJ6Wb RtbvBJ0Y08nIckZvwj28CI7ip5SrP4zBUVWX9lwwR5dDuQkXHz6r9QEpvDmY4uw5vGQc tdqU/MbU5jD/dCcAU26iV1tJDin5WWzLH98F25JiRLKiAJ06Hdxo3q5JMECQm2ZjZvR0 GE8TsXJpPg86VMOcy+8cmvZ7e6s3QjSXKjkSpsRSFvkIR7f3de28iFBSH3SSugqA8Ga2 2oQ5qCvdEo7dTEu2qZqh2IRb0XJCqhqxu8hs1KgegKBGFVDLcUBxaDZYG1b9l0oMW70b axrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=LMgyeyVMRm1Wl9EpredCl2+eHse1wecoeerS0Gb20vs=; b=frKa8bxX8XcgNjKTggeXtTu8nVxcz7eBYB7+GGzOzKp25q/jqy39RozLPVL03F3Sd9 MAlxcSGGLov1BVfQjJb2toB5FIesRTz/cR21P+Qa4ky9yximGmskMreCCmn210wyY98Q TFo0/UBIe+cfyBoLjk9hfQ5IXYXPEgFV6eTULkIO703NPQu8nlfmIxKSqlyjU20QBmVO V0Zmbrjf0tb+mV+f1nCwL97P1LUvGgwAUb5M0u4YoM+5YkR5POze5kjvAspWraukYhmO F5Wci90BNpkh1dvJujBFSuMoAUafFjp5vZ8JnEqpmrE5WALF7RX6cZiHN6RfKySdgWf+ KzPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lfb9pa60; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si3177588pgj.54.2019.07.10.13.34.48; Wed, 10 Jul 2019 13:35:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=@kernel.org header.s=default header.b=lfb9pa60; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726708AbfGJUeb (ORCPT + 99 others); Wed, 10 Jul 2019 16:34:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:38292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbfGJUeb (ORCPT ); Wed, 10 Jul 2019 16:34:31 -0400 Received: from gmail.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7904B208C4; Wed, 10 Jul 2019 20:34:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562790870; bh=p8lTAdy9Dw7yYQYivprX1MC6WmdEbIB5xt84U0h/OyQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lfb9pa60q496yHI3XOArioGoiwiRfVfWThAMS++R1aSfxRxrzpSH/++H6NPaxBF/m Hc6s3A1+3PdZn9H4HHMbn4i6bIvGtW65eCtMfN1pQ+t37oOVibe573MdYYFLhBoHuj 3QB+ExojtD602Zqg92T3CUm7oOo/VYbsCTevGHNQ= Date: Wed, 10 Jul 2019 13:34:29 -0700 From: Eric Biggers To: Gary R Hook Cc: "Hook, Gary" , "linux-crypto@vger.kernel.org" , "herbert@gondor.apana.org.au" , "davem@davemloft.net" , "Lendacky, Thomas" Subject: Re: [PATCH v2] crypto: ccp - memset structure fields to zero before reuse Message-ID: <20190710203428.GC83443@gmail.com> Mail-Followup-To: Gary R Hook , "Hook, Gary" , "linux-crypto@vger.kernel.org" , "herbert@gondor.apana.org.au" , "davem@davemloft.net" , "Lendacky, Thomas" References: <20190710000849.3131-1-gary.hook@amd.com> <20190710015725.GA746@sol.localdomain> <2875285f-d438-667e-52d9-801124ffba88@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2875285f-d438-667e-52d9-801124ffba88@amd.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Jul 10, 2019 at 03:59:05PM +0000, Gary R Hook wrote: > On 7/9/19 8:57 PM, Eric Biggers wrote: > > On Wed, Jul 10, 2019 at 12:09:22AM +0000, Hook, Gary wrote: > >> The AES GCM function reuses an 'op' data structure, which members > >> contain values that must be cleared for each (re)use. > >> > >> This fix resolves a crypto self-test failure: > >> alg: aead: gcm-aes-ccp encryption test failed (wrong result) on test vector 2, cfg="two even aligned splits" > >> > >> Fixes: 36cf515b9bbe ("crypto: ccp - Enable support for AES GCM on v5 CCPs") > >> > >> Signed-off-by: Gary R Hook > > > > FYI, with this patch applied I'm still seeing another test failure: > > > > [ 2.140227] alg: aead: gcm-aes-ccp setauthsize unexpectedly succeeded on test vector "random: alen=264 plen=161 authsize=6 klen=32"; expected_error=-22 > > > > Are you aware of that one too, and are you planning to fix it? > > > > - Eric > > > > I just pulled the latest on the master branch of cryptodev-2.6, built, > booted, and loaded our module. And I don't see that error. It must be new? Did you have CONFIG_CRYPTO_MANAGER_EXTRA_TESTS enabled? This failure was with a test vector that was generated randomly by the fuzz tests, so CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y is needed to reproduce it. You probably just need to update ccp_aes_gcm_setauthsize() to validate the authentication tag size. > > In any event, if a test failure occurs, it gets fixed. > Good to hear. - Eric