Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7716390ybi; Wed, 5 Jun 2019 23:54:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyLWA9ytwiBufdwQ89WhfIvy6prfb0Dn9w3/2hmFCGKnGUNw9DDYcdqmmBTQQyb7HliiHD X-Received: by 2002:a63:87c8:: with SMTP id i191mr1971129pge.131.1559804053188; Wed, 05 Jun 2019 23:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559804053; cv=none; d=google.com; s=arc-20160816; b=A7HLAx/JVKGz681TugLslK4qonkJjWpYSweCuQ6LgpH0IBFNUv1II0wDPDV3+LpDct cGn8BVqkmqTMxLQXhRnW7NDrE34FlB9WkK5AjDUl8D8+OtcE+Hc2EMZaCBCYyxj6gQ2z RT0w7bCwKjpUMi6WVuZXFqj5smNo9ivIOH01TQqCYMDR56QsV0P32/MXS8WMfEi7UYXd mFupG9jW8l3GuL7sMVY/q2MX3LLql9K9FnC3+EzE1xJMbt2c3ONl71PvS8GYc3uDwfh2 Y5sF47ZtqXnBJ/ElvHyOGaPwwvrPTMshUwH079jpE471wmfLLQYA9EFzZNEdRzbQm9o2 kg/w== 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; bh=JUAIIT7HQt7iaDn10gacrAvcBTD7iOD3Sv//qi73yLw=; b=ztFCuwuR8u/f5spLXGVyqsdQ+mh8TjBjeLQIBIO2fbCwcKlXhLFexqccg0hAdlrycI KytMZN508RjbqUYJre8JlQAKd4WvMr1djVmvCBX9fPnRCLNLab7cbfiT3jux6JlR57rK cOE/nzKhBi9nzdV0LMw+YAAMhg3owaSxkU4Jc05E4UQ/UlH3OeP4p51pQgreXeKInAhk G18qLvBn/kAxemw67mDbwMbvUF3XK8EVIfc9Mimh0bmnHUzT6EuforNO49/qikDDmoi8 70Wu1Xlq+BWhYMD6tnTfVzSCnAIrnnhQnyhm1ziZppgdeO72P/OyClev3FYDW/ezNiMb QJdA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d23si1378713pgd.198.2019.06.05.23.53.58; Wed, 05 Jun 2019 23:54:13 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726103AbfFFGxt (ORCPT + 99 others); Thu, 6 Jun 2019 02:53:49 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:38920 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725947AbfFFGxt (ORCPT ); Thu, 6 Jun 2019 02:53:49 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1hYmHS-0006ws-IC; Thu, 06 Jun 2019 14:53:46 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1hYmHQ-0006kd-Kb; Thu, 06 Jun 2019 14:53:44 +0800 Date: Thu, 6 Jun 2019 14:53:44 +0800 From: Herbert Xu To: Eric Biggers Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Peter Robinson , stable@vger.kernel.org Subject: Re: [PATCH] crypto: ghash - fix unaligned memory access in ghash_setkey() Message-ID: <20190606065344.rknt37tufeojyrbf@gondor.apana.org.au> References: <20190530175039.195574-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190530175039.195574-1-ebiggers@kernel.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, May 30, 2019 at 10:50:39AM -0700, Eric Biggers wrote: > From: Eric Biggers > > Changing ghash_mod_init() to be subsys_initcall made it start running > before the alignment fault handler has been installed on ARM. In kernel > builds where the keys in the ghash test vectors happened to be > misaligned in the kernel image, this exposed the longstanding bug that > ghash_setkey() is incorrectly casting the key buffer (which can have any > alignment) to be128 for passing to gf128mul_init_4k_lle(). > > Fix this by memcpy()ing the key to a temporary buffer. > > Don't fix it by setting an alignmask on the algorithm instead because > that would unnecessarily force alignment of the data too. > > Fixes: 2cdc6899a88e ("crypto: ghash - Add GHASH digest algorithm for GCM") > Reported-by: Peter Robinson > Cc: stable@vger.kernel.org > Signed-off-by: Eric Biggers > Tested-by: Peter Robinson > --- > crypto/ghash-generic.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt