From patchwork Fri Nov 18 09:02: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: 13047871 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 EDC0EC4332F for ; Fri, 18 Nov 2022 09:05:15 +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=q38+mRRCh/iP/b0sk4Tfma0Y5t8DCYVu1lNioWVykRU=; b=bBRqsVvR8SOeOn MdvLEsd1VIbtSE5nJmClc3QYifQDuPlWEsTMQPLXskc9z4YtR+sHPgTwoaaorR07iqb1xUkr2iFsn 9ZYqiudCxJxoMvsr1DkYS0NXK+rKmITwxgtO7EEsHxirXv/l0vLxBAmVpA0Ha4hXGtDlZF91GCeHl 19IeJ17gbqxTrQEsuP+VmJa2rHkkWG/Sg90GxRNA1IjMsTjR/t7vzHeVOTXgDiBW48O+tvGRrVjUq 1fuZhAfZSGRmmtC1iSWFNCq/JrlxDFJ60ejkJx2aL748C6TMXJZ2jyYTv/SruhddWwKX8Q54EQb0k 70BWDiAUYiYvKObT5W2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovxIC-002vxz-Hg; Fri, 18 Nov 2022 09:04:12 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovxI9-002vts-3b for linux-arm-kernel@lists.infradead.org; Fri, 18 Nov 2022 09:04:10 +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 dfw.source.kernel.org (Postfix) with ESMTPS id E9F66623B1; Fri, 18 Nov 2022 09:04:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31645C433D6; Fri, 18 Nov 2022 09:04:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668762247; bh=KRw+9QU2Y+5Ndy6X4gvLNK6thFtjiYVI50HPGDvhIC0=; h=From:To:Cc:Subject:Date:From; b=Em5RV/Y+F5ofQTN99D7pT/yt3tbdNQI4xxUUkHbSIVkiWgirgtaqGRE1iIzGP22f1 zaP02BMDZZ4RUMZKUgsdqhXyRYnphu2j8pRWTyntakod3AAbupfdGm3JM8IfYgRZZv e7E6OcF+lsDugD5xNEiNzkONGZYEu6LD5mCkoD4TLcDlOvQKur8YO1INC36L5svOY/ 2I1R0muUY+L/FdiH4zB3ySfaGKGAJb9jqyc8AO8t+uOt9NoH8hP+HhIsqz9T/QqLu5 q261W8CFtO4aLBy+3keknkgWY9ASr//Oe1D/fYD6r/85OroeI43FfS/THHdu33uXUE BXn3/FI12T6tw== From: Eric Biggers To: linux-crypto@vger.kernel.org Cc: x86@kernel.org, linux-arm-kernel@lists.infradead.org, Sami Tolvanen Subject: [PATCH 0/11] crypto: CFI fixes Date: Fri, 18 Nov 2022 01:02:09 -0800 Message-Id: <20221118090220.398819-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_010409_226558_D3AA71E9 X-CRM114-Status: GOOD ( 11.07 ) 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. Eric Biggers (11): crypto: x86/aegis128 - fix 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: 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 | 4 ++-- 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 ++- crypto/shash.c | 18 +++--------------- include/crypto/internal/hash.h | 8 +++++++- 23 files changed, 62 insertions(+), 81 deletions(-) base-commit: 557ffd5a4726f8b6f0dd1d4b632ae02c1c063233 Acked-by: Peter Zijlstra (Intel) Reviewed-by: Sami Tolvanen