Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5330196ybv; Tue, 11 Feb 2020 13:38:58 -0800 (PST) X-Google-Smtp-Source: APXvYqxz6/WhfRrP3uRXFr4cu6KhfdeDvnOxCPoXNrQnmH3vO8OYjUX+OsSrxDR6/MHLaTBgo7A9 X-Received: by 2002:a05:6830:13da:: with SMTP id e26mr6399570otq.97.1581457138271; Tue, 11 Feb 2020 13:38:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581457138; cv=none; d=google.com; s=arc-20160816; b=DuS2K7lEfloVq9ZZKpNdvqXfgn0y74QCtSnREnxTKdxv6X832OVO1cBU1XsP+DUvx6 Kg0YBeYJYfWx2aChS0lRve2CIgWvG1eZ5aGMvWeiQGY696lcGfj7CcdtopBmLhGRtrtU dKmERGqTyXJMTlO6SeALy+lf0lOQxOiO/BDp4iG9JKxXkCMdRKX0l/4iX4+0YWgqTIrw 9cY1h7ONNBAL6b1/M8r/+QH5oDfy5Kl4olqAB0SJHtJGU9oGp6z1KPFvEeCKLYFTgpDq BzCyN6IgNFBeXgD0FS395DhAkxl/RvxJC+vc0F7eNQ23Pe7wQsJW89JnQVyWYjX8we8q 4vog== 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:message-id:subject:cc :to:from:date:dkim-signature; bh=AEGWYfFX9245MukYgsGUL84+IjZfZx4XP83WQpnQkHw=; b=h4BsCczNtNUyoj/1dPOsLx73i9UyCDWemumRQ+KeX0tI0h9pFl1TkEqtnXuPdTv8mo J6LS22aUjUkS58iXpIXyoNm3z182Cj9maRP7JylccCwHvfzkChkOpyMs21cNHdTmGkmi L21+JHat0/fHLo+WHjl3PTe3PIkAlq6DYyyMxtVfhN07fhQdZpMZeZvHfaF70cIr2Ina JSQQEfbfuWkEKemIFXtEIvRYWbuUqCNTW3q+BZ4/jwH5cxwFEQd11lOx1H762nVJAGx1 bddXEqpdlEn4ULwHMeuHguoXE9hjaeKvhhHDrzUuIxhnNNBSACuJjv7AF8ix7CZU5Jd/ 6R7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=A2TzVFOW; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j3si2105330oie.86.2020.02.11.13.38.46; Tue, 11 Feb 2020 13:38:58 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=A2TzVFOW; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730852AbgBKTVW (ORCPT + 99 others); Tue, 11 Feb 2020 14:21:22 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:32943 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729800AbgBKTVW (ORCPT ); Tue, 11 Feb 2020 14:21:22 -0500 Received: by mail-wr1-f67.google.com with SMTP id u6so13947816wrt.0; Tue, 11 Feb 2020 11:21:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=AEGWYfFX9245MukYgsGUL84+IjZfZx4XP83WQpnQkHw=; b=A2TzVFOW6F10JBsePK3zu458Q3Vas14sw10YF6Uo0daSQJAYxApnG0/CppNxgLNFkC 62caMBdepV56f3CUUlOGU1KMLPNHRoueumUKE2HrBlFOmST6YIO4peQ2p09gyEwJmj45 5blcd8z3oTfYeXi546h4IE/QNiwSLqbjbYFZVKoWrNvWW0WeybSkyQY1qjOuCk6lwS8M 146Tc1XPAJNAS2SJg0O/FbFcT2NnuCqFGrRnMU6Bm9SAQOAOsLY81z3wjRg7l0fxhw/P Ag1ghXSk0KrokGHYloHR6z3m78+C13HNldnl1QEKCm6GXf9PpRXqqhzs1e6y0eITbChv jfHA== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=AEGWYfFX9245MukYgsGUL84+IjZfZx4XP83WQpnQkHw=; b=Y5Yz3woum8OPo0SeENOeGLCqv4o3WhKjZaVXWzKnoWrHrKN/6McoDpJTHGYF568QeR 7Agl3KK1LfpSIEwKO7EG8cq9C+WBbC3083dWtHLiTVzNF/oCb6FZ9Sl19ylMJ1M7A+wu wMmHJMh5J/gxgMb356WB1Ve0pm/slZiA+qBFnW5qzFy8jDjr1Lmx2lCvZ/CLJzhH/KuS EwPAHokT2zGNN/GFpTmQYHMHNuIPWK2NU9QTyo0wrjNsWA6YZStq3iT1X09nt153VewS dU6pMtJ9WebRFV/AXZnulLMYIzpH3vb3YrYwAIqSzOa1e03xaSxrlYJisx8cvJlU8DHk pg+w== X-Gm-Message-State: APjAAAWEFxXD6uWqrZHxCUHAf4N20Yw1B7u7zGbVsSDMK3DhSeuS6Oip 2F7KTIAP1QfW++ijoIDohO8= X-Received: by 2002:a5d:6082:: with SMTP id w2mr10143766wrt.300.1581448880361; Tue, 11 Feb 2020 11:21:20 -0800 (PST) Received: from Red ([2a01:cb1d:3d5:a100:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id q10sm4941740wme.16.2020.02.11.11.21.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 11:21:19 -0800 (PST) Date: Tue, 11 Feb 2020 20:21:18 +0100 From: Corentin Labbe To: Herbert Xu Cc: Eric Biggers , davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [BUG] crypto: export() overran state buffer on test vector Message-ID: <20200211192118.GA24059@Red> References: <20200206085442.GA5585@Red> <20200207065719.GA8284@sol.localdomain> <20200207104659.GA10979@Red> <20200208085713.ftuqxhatk6iioz7e@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200208085713.ftuqxhatk6iioz7e@gondor.apana.org.au> 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 Sat, Feb 08, 2020 at 04:57:13PM +0800, Herbert Xu wrote: > On Fri, Feb 07, 2020 at 11:46:59AM +0100, Corentin Labbe wrote: > > > > My goal is to do like n2-crypto/rk3288crypto/etc..., fallback for init/update/final/finup and only do stuff with digest(). > > So I have just exactly copied what they do. > > n2 at least is totally broken wrt import/export. The other ones > would work provided that the fallback have the same statesize as > the generic sha implementations. > This behavour happen only on arm64, so it is why probably nobody (rockchip/n2) found it. > Are you not using the standard state sizes? I use the standard size (statesize = sizeof(struct shaxxx_state)) As a quick workaround, By simply adding (+ 8), all test pass. > > This should probably be switched over to lib/crypto or at least > shash. > Do you mean that I should abandon ahash as a fallback ?