Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp103864yba; Mon, 20 May 2019 05:46:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxS6B2O2PyIXlK+/R/bcbXi9aAK/D4UlMLV4RjtVM0OeJXKdzu55DJcmxvnrsf6kouDGddU X-Received: by 2002:a63:9a52:: with SMTP id e18mr75339673pgo.335.1558356403472; Mon, 20 May 2019 05:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558356403; cv=none; d=google.com; s=arc-20160816; b=Ij3nZjqKEIAbVFGn65qW/hEfuHcj+mwc7rUaLKB9nR06XEcmSrCYV5wuJBt858l131 HYFzzKijhZdrhcM3yEEfFyhiICtLJttopOnRKTIjP5hO7n9rUwMdvSqRNiqiREKl3Srf t4OfQn7jY1FTbvRCkqDfXizmFnWsixSg6QG3Idi85IHNBtvzCu4f29zVCJSz97iMMhFF eKDNnoZ6+VD8Fq2aNtqgl2uMqjokm9nUHPaDYqAJuFBpBmaDv2V6lDO0dOTKCtWSMocs Pd4JcrbzCU4jOdvIal8K/T2Emp+zmrYSfIXm0dOAXSsvA130t+QuXh+tkkS4bD8oBcZJ yreg== 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=I4mlU/d4nVMBg1RXIulrkZeQBCHdC2YFJPQDvY554kXc2aMud5jzhqmzCcvh0mEUOU WszD+w8ZabjD3MppkdFAiK2SkVMvV3s7DdO5qXiwd8U0zmrPHir8EyqeBoQQALdRbTc7 0HqZuyfA7trgRJjd2X915CjXc+fOQ5B3fDeN1RKYHWdW+E7v2uKqRFhNGWdWKyiXPq+6 JC5RcTBoHuEAC0AsScFOygznwV2EXsHdWvixumjnjEnXOvs2wWYlIveJDbo7Hrehfugs TCoWfkTIZYtBbRiN0nVhseW8besjS087eQ96/IpjTCyZBh9MezRnTctuGuRBxNLVUczs kTKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="R/0JLT3Y"; 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 9si15265128pfc.90.2019.05.20.05.46.29; Mon, 20 May 2019 05:46:43 -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="R/0JLT3Y"; 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 S2389380AbfETM2v (ORCPT + 99 others); Mon, 20 May 2019 08:28:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:42226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389399AbfETM0r (ORCPT ); Mon, 20 May 2019 08:26:47 -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 D626520645; Mon, 20 May 2019 12:26:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558355207; bh=0msjDw4e8JU1SNWYIWYp0Zm3hjgfapzuhX6gELrNtSI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R/0JLT3YW4DIWouLEzO5J5eqyXTb3zciqjPjWaA30bU7v04ebSaqS3Ye6V5YTivB8 82v+tI08lh+6vOR6VOa7uJilIHCXZ2i13g3ymKEPOBeOrtSwMVvvqDysD9q9BE/wjP Q/Ea4fu/VgQboqoxn+Isa/X8UcvMiyHxBR3hbx0s= 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 5.0 032/123] crypto: vmx - fix copy-paste error in CTR mode Date: Mon, 20 May 2019 14:13:32 +0200 Message-Id: <20190520115246.894646115@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190520115245.439864225@linuxfoundation.org> References: <20190520115245.439864225@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: