From patchwork Fri Apr 24 06:37:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 47549 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 57E4F2121F for ; Fri, 24 Apr 2015 06:37:27 +0000 (UTC) Received: by wiun10 with SMTP id n10sf1826994wiu.1 for ; Thu, 23 Apr 2015 23:37:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=M989R7VxN0iXTQ9WHQ+C1ofAizaSUsJ6f20nrDmrEks=; b=GPuIqq1FN2SRT6mkv3KXbFUc4+LVAsa5/BPeHRJr6kDQKO0dKVqbGdGeivs+7zJvcA A0yx/8RaCv8cod2jMs/oGBYWoneidaJZePpgD3vAag8wrQKrG6DLVqCJCH28lg/Q9pA8 9wug+lv7ZacoCXJkdDzYmpSvP/J8yNCosUigqpju8V1XH59vPcyK1/WsqcOCJp9TwS9R VmECUg4DpK0GZOFUMwF9CfdOdhSREqFUd4cdkMmYqqEkKjoDK2nO4DLCPDLsjZpfZeMj GQaH5ihdWkfXk+1P1Ke6j7+Br4xPbV18p5H7uxD06XPFELK1uFxPYQFuqStpG5sxt2sD b/xw== X-Gm-Message-State: ALoCoQmjmeeW829FR+hyDBXh3YxUtmq0tk9QmN3rfiR2AEmtLaPKpT2JAIv5BaZG/8t6Eswrtn3b X-Received: by 10.180.96.6 with SMTP id do6mr286845wib.4.1429857446665; Thu, 23 Apr 2015 23:37:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.10.5 with SMTP id e5ls401014lab.37.gmail; Thu, 23 Apr 2015 23:37:26 -0700 (PDT) X-Received: by 10.112.25.69 with SMTP id a5mr5544955lbg.16.1429857446481; Thu, 23 Apr 2015 23:37:26 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id dp7si7551323lbc.155.2015.04.23.23.37.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Apr 2015 23:37:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbzk7 with SMTP id zk7so29445561lbb.0 for ; Thu, 23 Apr 2015 23:37:26 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr5524296lac.41.1429857446042; Thu, 23 Apr 2015 23:37:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp1001898lbt; Thu, 23 Apr 2015 23:37:25 -0700 (PDT) X-Received: by 10.70.53.99 with SMTP id a3mr3300626pdp.169.1429857444969; Thu, 23 Apr 2015 23:37:24 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si10814286pdk.61.2015.04.23.23.37.24 for ; Thu, 23 Apr 2015 23:37:24 -0700 (PDT) Received-SPF: none (google.com: linux-crypto-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932515AbbDXGhW (ORCPT ); Fri, 24 Apr 2015 02:37:22 -0400 Received: from mail-wg0-f46.google.com ([74.125.82.46]:33157 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932512AbbDXGhW (ORCPT ); Fri, 24 Apr 2015 02:37:22 -0400 Received: by wgin8 with SMTP id n8so40247760wgi.0 for ; Thu, 23 Apr 2015 23:37:21 -0700 (PDT) X-Received: by 10.194.7.97 with SMTP id i1mr12906983wja.107.1429857440988; Thu, 23 Apr 2015 23:37:20 -0700 (PDT) Received: from ards-macbook-pro.local ([84.78.25.77]) by mx.google.com with ESMTPSA id h5sm15471183wjn.20.2015.04.23.23.37.18 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Apr 2015 23:37:19 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au, torvalds@linux-foundation.org, smueller@chronox.de, davem@davemloft.net, linux-kernel@vger.kernel.org, bobbypowers@gmail.com Cc: Ard Biesheuvel Subject: [PATCH] crypto: x86/sha512_ssse3 - fixup for asm function prototype change Date: Fri, 24 Apr 2015 08:37:09 +0200 Message-Id: <1429857429-13323-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: References: Sender: linux-crypto-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Patch e68410ebf626 ("crypto: x86/sha512_ssse3 - move SHA-384/512 SSSE3 implementation to base layer") changed the prototypes of the core asm SHA-512 implementations so that they are compatible with the prototype used by the base layer. However, in one instance, the register that was used for passing the input buffer was reused as a scratch register later on in the code, and since the input buffer param changed places with the digest param -which needs to be written back before the function returns- this resulted in the scratch register to be dereferenced in a memory write operation, causing a GPF. Fix this by changing the scratch register to use the same register as the input buffer param again. Fixes: e68410ebf626 ("crypto: x86/sha512_ssse3 - move SHA-384/512 SSSE3 implementation to base layer") Reported-By: Bobby Powers Tested-By: Bobby Powers Signed-off-by: Ard Biesheuvel --- arch/x86/crypto/sha512-avx2-asm.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/crypto/sha512-avx2-asm.S b/arch/x86/crypto/sha512-avx2-asm.S index a4771dcd1fcf..1f20b35d8573 100644 --- a/arch/x86/crypto/sha512-avx2-asm.S +++ b/arch/x86/crypto/sha512-avx2-asm.S @@ -79,7 +79,7 @@ NUM_BLKS = %rdx c = %rcx d = %r8 e = %rdx -y3 = %rdi +y3 = %rsi TBL = %rbp