From patchwork Thu Jan 21 16:24:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cooper X-Patchwork-Id: 8082911 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DC5059F1CC for ; Thu, 21 Jan 2016 16:24:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 159102050E for ; Thu, 21 Jan 2016 16:24:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E4413204FF for ; Thu, 21 Jan 2016 16:24:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965183AbcAUQYh (ORCPT ); Thu, 21 Jan 2016 11:24:37 -0500 Received: from mout.gmx.net ([212.227.15.19]:54941 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964802AbcAUQYg (ORCPT ); Thu, 21 Jan 2016 11:24:36 -0500 Received: from dc7700.localdomain ([168.235.78.26]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MC4R6-1aDWal3P7Y-008o7A; Thu, 21 Jan 2016 17:24:32 +0100 From: Eli Cooper To: linux-crypto@vger.kernel.org, Martin Willi Cc: Herbert Xu Subject: [PATCH] crypto: chacha20_4block_xor_ssse3: Align stack pointer to 64 bytes Date: Fri, 22 Jan 2016 00:24:08 +0800 Message-Id: <1453393448-13636-1-git-send-email-elicooper@gmx.com> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:6FpsSUAdlW2bMniVtoQkxTfxSOPPk2JG9pye5EMwR0cn+wiLnsi pCeMMeoP/zgiwi7dxNk9akdQ6z9QIUzq4OkYhui+Ljw+hqcQr6ulnDneGFmopyi/siTgzN+ UWjasjXCxM7SJtnGslDqNWcdhqKW98KPcSrXWdXmTGjZjweu40t8uO3Icez5pl08l99fv/e ebyEwMJHq4HtX3QvXNYjQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:uN5znRlFpc0=:FufUEnJVMuzVAk3gJfJ8H9 4H+OgaXIhz9y9UCPx7REx4CIMyT0QWuMFt9jI/XCNq+7dXX7HDoRTn6Ab5jTsTsCyimXMsi+2 K6j+6xFQWP5FfCVaX56ZH2Vn5Tuz8cv9LYy8zdHs0lTOH5T39OVounbDZiNLFW8MPqOHWby+m hv+m+wadI4ULZ7Q7Ie4XVRgMrQkq33pg+hEsAk6yBzBd9wMg/PCcYv7/AJI4d3J9c1aaotPsJ 0NNGY5dXd1mYnhEi10qwVX6UmsHl98ys3Ep1V99NAKG1HD11y8+cdRtbHOSZUKrbg9cPDw9HR LYCO+95ONDJA3/k7XXVCPBokrhAh5lFQF8fJw5Onfqc3VSeZbp9c/gtDjzSNquwdxJkH2CT82 13how8yza02S2GGrUe6FFRys+vC9ozJGc87hcN8sYcrpuw0VXZbQr0emFxl/QcwNpVnNONB2E 1EhTgu9LxgRP4fg60OYyd6Fo4h57c6hOgJOzmkhF1mNd6su5PttMgFgGkATmLYS9+o0pI/aTc 7OaVtMxJP/ERPTj5ymsaawIEzD4ybflVRQhlGKuTauipYipxaiv34sIiRs+15kK4XJda7bPGv mhgcK3Ol5/DrPc4nXQvQCSBX4V73tGqiWNT3pV8gsPGYJ7PoBz9FECNiZQB/8ms5AF48P7Sed 9uQefTbnoESj6ziErvcalCgIs9dsuB3YJCXDIGVaMVvu/mvCFdyAcic9kN2u3OgdtN/Kwz0i4 ziuWHF9gRfj+Ri/yOXvPhdz5QveBfrLw7axc3okcdvMARTU52xNTb1gFNJI= Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This aligns the stack pointer in chacha20_4block_xor_ssse3 to 64 bytes. Fixes general protection faults and potential kernel panics. Cc: stable@vger.kernel.org Signed-off-by: Eli Cooper Acked-by: Martin Willi --- arch/x86/crypto/chacha20-ssse3-x86_64.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/crypto/chacha20-ssse3-x86_64.S b/arch/x86/crypto/chacha20-ssse3-x86_64.S index 712b130..3a33124 100644 --- a/arch/x86/crypto/chacha20-ssse3-x86_64.S +++ b/arch/x86/crypto/chacha20-ssse3-x86_64.S @@ -157,7 +157,9 @@ ENTRY(chacha20_4block_xor_ssse3) # done with the slightly better performing SSSE3 byte shuffling, # 7/12-bit word rotation uses traditional shift+OR. - sub $0x40,%rsp + mov %rsp,%r11 + sub $0x80,%rsp + and $~63,%rsp # x0..15[0-3] = s0..3[0..3] movq 0x00(%rdi),%xmm1 @@ -620,6 +622,6 @@ ENTRY(chacha20_4block_xor_ssse3) pxor %xmm1,%xmm15 movdqu %xmm15,0xf0(%rsi) - add $0x40,%rsp + mov %r11,%rsp ret ENDPROC(chacha20_4block_xor_ssse3)