From patchwork Fri Nov 18 19:44:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 13048742 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 179CAC4332F for ; Fri, 18 Nov 2022 19:53:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=WJ8PvZ/OSkla9FXjANIeIPyEgHvc/nOjHTSQ8g2EjYA=; b=SUE/j8LOjrE25D OBnq4jVDE1KLFVg+a+40eNdGdh39XAggNMpMBlQf7gzGkpXdJAjfHEfRiD+SiOqJS/5lRdG1mdMdE wOBx4SHF9L22FTcC5iHUj5nQ7l9E1HhXelkL+WQEX6S1cPvc5mpUC2oK3Hlz2etx7wMtGIoM8Rwma Ub7bl725p8i6GOCdt77nJPB7kY4S1s2691EaWikZMHkZEAIx5cGWbY7kGv1tzl1UYZiH3YoSk70NB KEa5Ro0PJ7SFmBjrJIFCnl9JIM+sYVfxSbareUQYdh43DzVXaoILIPPDYiOr5/SRxvOrd3uUdKXRk m152g7C4KnKoHLU3ZPXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ow7Q3-007kDa-Pw; Fri, 18 Nov 2022 19:53:00 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ow7Jq-007gzu-IB for linux-arm-kernel@lists.infradead.org; Fri, 18 Nov 2022 19:46:39 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id B1FBBCE2221; Fri, 18 Nov 2022 19:46:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC4AAC433C1; Fri, 18 Nov 2022 19:46:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668800783; bh=pRruGOUsFyZsKb+BNIESqnaa7mp7RB+efAYZD68W7hA=; h=From:To:Cc:Subject:Date:From; b=X1SQLTidNZJv2ERVwOZ8JKwakO4kxNgRU71p2Fe2+P3djxyakCkM/Wi4HaXbXoHER sxveURIIPxqJ0E+Eujq9mnedZ05QweQuUwdH0H2CUfi/Xry9yu+ycXq7xv5yLe+8af 7Yga+eDdR/P8Hjq7wkEKRn23XPgK/+EZuDFDeIHsDexPXTEfwugR2qTZLaQrMYeXPo jfXUwuACTlzY2WgubcjUpgYjVXMKgXgpHz+mhl9em4S0I44np3QvwP0Msvh2UG3TkN v/azqurLBkhMD3LTugIf42yuaxOFHztwu9BugZBTmhovZ7W9OmzY4IkjY+bAlyMszA gL2pCJIoeisuw== From: Eric Biggers To: linux-crypto@vger.kernel.org Cc: x86@kernel.org, linux-arm-kernel@lists.infradead.org, Sami Tolvanen Subject: [PATCH v2 00/12] crypto: CFI fixes Date: Fri, 18 Nov 2022 11:44:09 -0800 Message-Id: <20221118194421.160414-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221118_114635_029289_B4A50A03 X-CRM114-Status: GOOD ( 11.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series fixes some crashes when CONFIG_CFI_CLANG (Control Flow Integrity) is enabled, with the new CFI implementation that was merged in 6.1 and is supported on x86. Some of them were unconditional crashes, while others depended on whether the compiler optimized out the indirect calls or not. This series also simplifies some code that was intended to work around limitations of the old CFI implementation and is unnecessary for the new CFI implementation. Changed in v2: - Added patch "crypto: x86/sm4 - fix crash with CFI enabled" - Restored accidentally-deleted include of - Tweaked some commit messages and added Reviewed-by and Acked-by tags Eric Biggers (12): crypto: x86/aegis128 - fix possible crash with CFI enabled crypto: x86/aria - fix crash with CFI enabled crypto: x86/nhpoly1305 - eliminate unnecessary CFI wrappers crypto: x86/sha1 - fix possible crash with CFI enabled crypto: x86/sha256 - fix possible crash with CFI enabled crypto: x86/sha512 - fix possible crash with CFI enabled crypto: x86/sm3 - fix possible crash with CFI enabled crypto: x86/sm4 - fix crash with CFI enabled crypto: arm64/nhpoly1305 - eliminate unnecessary CFI wrapper crypto: arm64/sm3 - fix possible crash with CFI enabled crypto: arm/nhpoly1305 - eliminate unnecessary CFI wrapper Revert "crypto: shash - avoid comparing pointers to exported functions under CFI" arch/arm/crypto/nh-neon-core.S | 2 +- arch/arm/crypto/nhpoly1305-neon-glue.c | 11 ++--------- arch/arm64/crypto/nh-neon-core.S | 5 +++-- arch/arm64/crypto/nhpoly1305-neon-glue.c | 11 ++--------- arch/arm64/crypto/sm3-neon-core.S | 3 ++- arch/x86/crypto/aegis128-aesni-asm.S | 9 +++++---- arch/x86/crypto/aria-aesni-avx-asm_64.S | 13 +++++++------ arch/x86/crypto/nh-avx2-x86_64.S | 5 +++-- arch/x86/crypto/nh-sse2-x86_64.S | 5 +++-- arch/x86/crypto/nhpoly1305-avx2-glue.c | 11 ++--------- arch/x86/crypto/nhpoly1305-sse2-glue.c | 11 ++--------- arch/x86/crypto/sha1_ni_asm.S | 3 ++- arch/x86/crypto/sha1_ssse3_asm.S | 3 ++- arch/x86/crypto/sha256-avx-asm.S | 3 ++- arch/x86/crypto/sha256-avx2-asm.S | 3 ++- arch/x86/crypto/sha256-ssse3-asm.S | 3 ++- arch/x86/crypto/sha256_ni_asm.S | 3 ++- arch/x86/crypto/sha512-avx-asm.S | 3 ++- arch/x86/crypto/sha512-avx2-asm.S | 3 ++- arch/x86/crypto/sha512-ssse3-asm.S | 3 ++- arch/x86/crypto/sm3-avx-asm_64.S | 3 ++- arch/x86/crypto/sm4-aesni-avx-asm_64.S | 7 ++++--- arch/x86/crypto/sm4-aesni-avx2-asm_64.S | 7 ++++--- crypto/shash.c | 18 +++--------------- include/crypto/internal/hash.h | 8 +++++++- 25 files changed, 70 insertions(+), 86 deletions(-) base-commit: 75df46b598b5b46b0857ee7d2410deaf215e23d1