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=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED 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 B2BF1C43381 for ; Mon, 18 Mar 2019 06:03:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7DD6B20700 for ; Mon, 18 Mar 2019 06:03:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726124AbfCRGDP convert rfc822-to-8bit (ORCPT ); Mon, 18 Mar 2019 02:03:15 -0400 Received: from ozlabs.org ([203.11.71.1]:33189 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725949AbfCRGDO (ORCPT ); Mon, 18 Mar 2019 02:03:14 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 44N5Fq2NFhz9s6w; Mon, 18 Mar 2019 17:03:10 +1100 (AEDT) From: Michael Ellerman To: Daniel Axtens , omosnacek@gmail.com, linux-crypto@vger.kernel.org, Herbert Xu Cc: leo.barbosa@canonical.com, Stephan Mueller , nayna@linux.ibm.com, leitao@debian.org, pfsmorigo@gmail.com, marcelo.cerri@canonical.com, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] crypto: vmx - fix copy-paste error in CTR mode In-Reply-To: <20190315020901.16509-1-dja@axtens.net> References: <20190315020901.16509-1-dja@axtens.net> Date: Mon, 18 Mar 2019 17:03:07 +1100 Message-ID: <87sgvk7m90.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Daniel Axtens writes: > The original assembly imported from OpenSSL has two copy-paste > errors in handling CTR mode. When dealing with a 2 or 3 block tail, > the code branches to the CBC decryption exit path, rather than to > the CTR exit path. > > This leads to corruption of the IV, which leads to subsequent blocks > being corrupted. > > This can be detected with libkcapi test suite, which is available at > https://github.com/smuellerDD/libkcapi > > Reported-by: Ondrej Mosnáček > Fixes: 5c380d623ed3 ("crypto: vmx - Add support for VMS instructions by ASM") > Cc: stable@vger.kernel.org > Signed-off-by: Daniel Axtens Thanks, this fixes kcapi-enc-test.sh for me. Tested-by: Michael Ellerman cheers