From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D9A5C4332D for ; Fri, 20 Mar 2020 03:48:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 17C2820722 for ; Fri, 20 Mar 2020 03:48:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726614AbgCTDsz (ORCPT ); Thu, 19 Mar 2020 23:48:55 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:33854 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725884AbgCTDsz (ORCPT ); Thu, 19 Mar 2020 23:48:55 -0400 Received: from gwarestrin.me.apana.org.au ([192.168.0.7] helo=gwarestrin.arnor.me.apana.org.au) by fornost.hmeau.com with smtp (Exim 4.89 #2 (Debian)) id 1jF8eA-0001To-MJ; Fri, 20 Mar 2020 14:48:35 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Fri, 20 Mar 2020 14:48:34 +1100 Date: Fri, 20 Mar 2020 14:48:34 +1100 From: Herbert Xu To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, gregkh@linuxfoundation.org, Emil Renner Berthing , Ard Biesheuvel , stable@vger.kernel.org Subject: Re: [PATCH URGENT crypto v2] crypto: arm64/chacha - correctly walk through blocks Message-ID: <20200320034834.GA27372@gondor.apana.org.au> References: <20200319022732.166085-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200319022732.166085-1-Jason@zx2c4.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, Mar 18, 2020 at 08:27:32PM -0600, Jason A. Donenfeld wrote: > Prior, passing in chunks of 2, 3, or 4, followed by any additional > chunks would result in the chacha state counter getting out of sync, > resulting in incorrect encryption/decryption, which is a pretty nasty > crypto vuln: "why do images look weird on webpages?" WireGuard users > never experienced this prior, because we have always, out of tree, used > a different crypto library, until the recent Frankenzinc addition. This > commit fixes the issue by advancing the pointers and state counter by > the actual size processed. It also fixes up a bug in the (optional, > costly) stride test that prevented it from running on arm64. > > Fixes: b3aad5bad26a ("crypto: arm64/chacha - expose arm64 ChaCha routine as library function") > Reported-and-tested-by: Emil Renner Berthing > Cc: Ard Biesheuvel > Cc: stable@vger.kernel.org # v5.5+ > Signed-off-by: Jason A. Donenfeld > --- > arch/arm64/crypto/chacha-neon-glue.c | 8 ++++---- > lib/crypto/chacha20poly1305-selftest.c | 11 ++++++++--- > 2 files changed, 12 insertions(+), 7 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt