Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1825045imm; Sat, 23 Jun 2018 03:38:04 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJwh5t7PVXt5GfsZQBTkag80zLQ+dvU1g8MpxJ2+Bw7gAwaH3H6oear2DiFs3C+BjjQPIPG X-Received: by 2002:a62:5004:: with SMTP id e4-v6mr5233599pfb.71.1529750284333; Sat, 23 Jun 2018 03:38:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529750284; cv=none; d=google.com; s=arc-20160816; b=L/8JQCzyq+M9YbbJ0AKweizX92xgEis7NokK6cg1o8+2rPcXvL7Ue0TAZgNYJ8Pm9P mkOA04Ylejinr30qPhpmLjuSd3A7G1XD7WznZYatelsh6WvlPkqqXe3X4020YbexJoOr a1EW9cn4nKaZQtnzso6Y70rqHQVNF4AwAhzsP3QDKp/4E11t5HsrrjYotbkm7Ddbe9Lv T9Mr5lcuCV3wW+9YbEvxFAL1m76wcOKJsYYH8ZhjOPQU5RY1XbIpsLkwc+AiqMOpdYDW O/4mXX8PepAkFgv9YnpUi4xpVjP989pAF3ht/I9NJaO471g8VY0R7h8tonLphS8+ncbg X6JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=hZxt69Kfvji3zY4HwOn7pFWjUbqg30mSfMwDPQSAeqo=; b=MjpEMQA0nZOI5mRcgk+sNyrZ5CcVvJdwjSy4EQCbBpWqMgfX97aQgPuUtoeeskPU5D ymcq278GulJaNskZXSS9/5cYPdgY5UjO1uo36e3grjmaZGVjgijKvGSZ22D7ciiWA0KF g6v2pErkXW38Xasl8bUBvRzuRX6Z5ZZ5vxAgvaEreUrMqRR7ZnlPV2UkJSIu4DQrroGh J0mrMjPgT5bcrFGmWNrUNuhNh1Rp2JQhWD3GWI2DHUSY1M2CdJwlHF9cZw/vx6OnG7eB Nz0hM5xfUHoLNvqpv5qjH6+4seVBslv6OrNwRcPa4zn6dur4SYtlwn0grkfUYXoUSUF8 AYPA== ARC-Authentication-Results: i=1; mx.google.com; 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 1-v6si9306897plv.16.2018.06.23.03.37.34; Sat, 23 Jun 2018 03:38:04 -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; 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 S1751613AbeFWKg2 (ORCPT + 99 others); Sat, 23 Jun 2018 06:36:28 -0400 Received: from mail.skyhub.de ([5.9.137.197]:36068 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751385AbeFWKg0 (ORCPT ); Sat, 23 Jun 2018 06:36:26 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id k8jjMG97RbxD; Sat, 23 Jun 2018 12:36:25 +0200 (CEST) Received: from zn.tnic (p200300EC2BDC2300329C23FFFEA6A903.dip0.t-ipconnect.de [IPv6:2003:ec:2bdc:2300:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 26BB01EC019F; Sat, 23 Jun 2018 12:36:25 +0200 (CEST) Date: Sat, 23 Jun 2018 12:36:22 +0200 From: Borislav Petkov To: linux-crypto@vger.kernel.org Cc: Mike Galbraith , Alexey Dobriyan , torvalds@linux-foundation.org, tglx@linutronix.de, mingo@kernel.org, jpoimboe@redhat.com, luto@kernel.org, peterz@infradead.org, brgerst@gmail.com, hpa@zytor.com, linux-kernel@vger.kernel.org, dvlasenk@redhat.com, h.peter.anvin@intel.com, linux-tip-commits , Herbert Xu Subject: [PATCH] x86/crypto: Add missing RETs Message-ID: <20180623103622.GA2760@zn.tnic> References: <20180507213755.GA32406@avx2> <1529235613.4572.7.camel@gmx.de> <20180617120012.GB16877@zn.tnic> <1529242717.4472.3.camel@gmx.de> <1529244178.4674.1.camel@gmx.de> <20180617194747.GA21160@zn.tnic> <1529289279.31745.3.camel@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1529289279.31745.3.camel@gmx.de> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Lemme send a proper patch now... --- From: Borislav Petkov Date: Sun, 17 Jun 2018 13:57:42 +0200 Subject: [PATCH] x86/crypto: Add missing RETs Add explicit RETs to the tail calls of AEGIS and MORUS crypto algorithms otherwise they run into INT3 padding due to 51bad67ffbce ("x86/asm: Pad assembly functions with INT3 instructions") leading to spurious debug exceptions. Mike Galbraith took care of all the remaining callsites. Signed-off-by: Borislav Petkov --- arch/x86/crypto/aegis128-aesni-asm.S | 1 + arch/x86/crypto/aegis128l-aesni-asm.S | 1 + arch/x86/crypto/aegis256-aesni-asm.S | 1 + arch/x86/crypto/morus1280-avx2-asm.S | 1 + arch/x86/crypto/morus1280-sse2-asm.S | 1 + arch/x86/crypto/morus640-sse2-asm.S | 1 + 6 files changed, 6 insertions(+) diff --git a/arch/x86/crypto/aegis128-aesni-asm.S b/arch/x86/crypto/aegis128-aesni-asm.S index 9254e0b6cc06..717bf0776421 100644 --- a/arch/x86/crypto/aegis128-aesni-asm.S +++ b/arch/x86/crypto/aegis128-aesni-asm.S @@ -535,6 +535,7 @@ ENTRY(crypto_aegis128_aesni_enc_tail) movdqu STATE3, 0x40(STATEP) FRAME_END + ret ENDPROC(crypto_aegis128_aesni_enc_tail) .macro decrypt_block a s0 s1 s2 s3 s4 i diff --git a/arch/x86/crypto/aegis128l-aesni-asm.S b/arch/x86/crypto/aegis128l-aesni-asm.S index 9263c344f2c7..4eda2b8db9e1 100644 --- a/arch/x86/crypto/aegis128l-aesni-asm.S +++ b/arch/x86/crypto/aegis128l-aesni-asm.S @@ -645,6 +645,7 @@ ENTRY(crypto_aegis128l_aesni_enc_tail) state_store0 FRAME_END + ret ENDPROC(crypto_aegis128l_aesni_enc_tail) /* diff --git a/arch/x86/crypto/aegis256-aesni-asm.S b/arch/x86/crypto/aegis256-aesni-asm.S index 1d977d515bf9..32aae8397268 100644 --- a/arch/x86/crypto/aegis256-aesni-asm.S +++ b/arch/x86/crypto/aegis256-aesni-asm.S @@ -543,6 +543,7 @@ ENTRY(crypto_aegis256_aesni_enc_tail) state_store0 FRAME_END + ret ENDPROC(crypto_aegis256_aesni_enc_tail) /* diff --git a/arch/x86/crypto/morus1280-avx2-asm.S b/arch/x86/crypto/morus1280-avx2-asm.S index 37d422e77931..07653d4582a6 100644 --- a/arch/x86/crypto/morus1280-avx2-asm.S +++ b/arch/x86/crypto/morus1280-avx2-asm.S @@ -453,6 +453,7 @@ ENTRY(crypto_morus1280_avx2_enc_tail) vmovdqu STATE4, (4 * 32)(%rdi) FRAME_END + ret ENDPROC(crypto_morus1280_avx2_enc_tail) /* diff --git a/arch/x86/crypto/morus1280-sse2-asm.S b/arch/x86/crypto/morus1280-sse2-asm.S index 1fe637c7be9d..bd1aa1b60869 100644 --- a/arch/x86/crypto/morus1280-sse2-asm.S +++ b/arch/x86/crypto/morus1280-sse2-asm.S @@ -652,6 +652,7 @@ ENTRY(crypto_morus1280_sse2_enc_tail) movdqu STATE4_HI, (9 * 16)(%rdi) FRAME_END + ret ENDPROC(crypto_morus1280_sse2_enc_tail) /* diff --git a/arch/x86/crypto/morus640-sse2-asm.S b/arch/x86/crypto/morus640-sse2-asm.S index 71c72a0a0862..efa02816d921 100644 --- a/arch/x86/crypto/morus640-sse2-asm.S +++ b/arch/x86/crypto/morus640-sse2-asm.S @@ -437,6 +437,7 @@ ENTRY(crypto_morus640_sse2_enc_tail) movdqu STATE4, (4 * 16)(%rdi) FRAME_END + ret ENDPROC(crypto_morus640_sse2_enc_tail) /* -- 2.17.0.582.gccdcbd54c -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.