Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp107745yba; Mon, 20 May 2019 05:51:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5T3vsK7JsAVkTnsDQ8uB2bx+TX9H/tUwXkSrdSBsJR0cFfeGIz3RlPiFHY6FHBIeislGl X-Received: by 2002:a63:1866:: with SMTP id 38mr75480606pgy.123.1558356669195; Mon, 20 May 2019 05:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558356669; cv=none; d=google.com; s=arc-20160816; b=etMQdh1f+gA9N/eQYfhh1Uf8owNbP/PrFitV1B4VUGDypy+nmuGm3zJvpVfABzvKFr Vj2CXtXlDFFYi2lQUXI4ovHVFpdUW168ZTNCcqpsHh7Wt7paENDw9+szAB5ZFY5oyANK Rj1ACRyuSbG8dXcLAFFShZqkSmTGc96Z7OoHsIysPijqdP2fMVynlLw+68MZnyCo9WYy XKSMswOeXMbGlEC5R5j4DC/hE8/HETpBk7EHeLHITEScJFA34MctKViljbqOCyy37YIt 1doy+0fw1LSBp68V2DdasIjNpiX90GIt1IS2Qbe3iOwSDaGFKCD8WZFFEThJ5Uu5dv/0 rulA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5tTcikucb18OJkzjx7Ntd9cPigBA9ao5DeRxuIOm3H0=; b=qT5n20j0uRAVqSfKMgekop36SvgS4I5isBrsdUk76rTSkHlndZZKbF4C/cTpOdv7QF PxzP42zA59jybNWAKt2zrBsgZEYqWXHEJJZI317r8JhrCTvD2neEzMiQbPHgGN8cUVmE ZpC1f6bE32H406YD02fLj53QZAxJa9l2pTgYTf0z21s/5pk80cZW0w1XmVE/GZRCCcLW ijY0p9GDKKOrJtEBa0Umk9NDnoARHSVoAPazW0rTB4hWixv1t/FqrPUs4JP54kpM9ruT gFpMzO1gJurXIy3eqeOhjF/sspoRnIEl97JjkWz5+WdystRhHbtHmcQKj9ZTHF6S/Nhr OMJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HVZlsWNy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 u68si18845573pgc.72.2019.05.20.05.50.54; Mon, 20 May 2019 05:51:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=HVZlsWNy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388321AbfETMVx (ORCPT + 99 others); Mon, 20 May 2019 08:21:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:35562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388266AbfETMVq (ORCPT ); Mon, 20 May 2019 08:21:46 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 64BE0214AE; Mon, 20 May 2019 12:21:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558354905; bh=0msjDw4e8JU1SNWYIWYp0Zm3hjgfapzuhX6gELrNtSI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HVZlsWNyV8mAra0RYttdjtGHW6IMQeOG/na0sSp3wxbaFgeF7kjovpWtTPUPKAlqf 1VHOfC6NxK3pBtzzPch8ZADA1I+aSY0Sg9f3FDMok7+tiXkDUu8gQgT9IHyouvB1il 3n3bNrNZhJpTUDRT8oZLiiVFtnjX2FKYL8CY6/j4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Ondrej=20Mosn=C3=A1=C4=8Dek?= , Daniel Axtens , Michael Ellerman , Herbert Xu Subject: [PATCH 4.19 023/105] crypto: vmx - fix copy-paste error in CTR mode Date: Mon, 20 May 2019 14:13:29 +0200 Message-Id: <20190520115248.624559369@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115247.060821231@linuxfoundation.org> References: <20190520115247.060821231@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Axtens commit dcf7b48212c0fab7df69e84fab22d6cb7c8c0fb9 upstream. 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 Tested-by: Michael Ellerman Tested-by: Ondrej Mosnacek Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/vmx/aesp8-ppc.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/crypto/vmx/aesp8-ppc.pl +++ b/drivers/crypto/vmx/aesp8-ppc.pl @@ -1854,7 +1854,7 @@ Lctr32_enc8x_three: stvx_u $out1,$x10,$out stvx_u $out2,$x20,$out addi $out,$out,0x30 - b Lcbc_dec8x_done + b Lctr32_enc8x_done .align 5 Lctr32_enc8x_two: @@ -1866,7 +1866,7 @@ Lctr32_enc8x_two: stvx_u $out0,$x00,$out stvx_u $out1,$x10,$out addi $out,$out,0x20 - b Lcbc_dec8x_done + b Lctr32_enc8x_done .align 5 Lctr32_enc8x_one: