Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp287990rwb; Fri, 18 Nov 2022 01:12:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf7h4JPE4PVtrtGP5dd0EwT6oLHe5BxMKWSIqcXiV+ccPRy5XJEsPPrU1zf6oDCDT1p3S8Xm X-Received: by 2002:a17:907:77c1:b0:7b2:ace3:f3 with SMTP id kz1-20020a17090777c100b007b2ace300f3mr2328244ejc.341.1668762752365; Fri, 18 Nov 2022 01:12:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668762752; cv=none; d=google.com; s=arc-20160816; b=WuN3r6LfM1kty9mRe9BVwnpgQYcbSM9El0drDg3YFq3y9IiGn7CkzSe32zQUB1ioDq ApQOMyKMlEi2sla90c2ferdTD/6i/vUvKHMhKIT2RdybeK+maYg1lXyjsYkpU8BhhY4R lrxDb0z0gn4H3NY8RkZ0YgAqX/+3ETf4XiDrIZs4oDOhJDD61Jgpl7trrkgFj4vwPx3k 9PYl07pwbXDQCU/FFjpb+NCO1h1SImRKUVqCLyeT1M1UzMMoP1O7aQcxG6ep3PfkjceG Pv/7w3njFl0kwbKEQlrRyt63yOyOZIsCXAZrTdlUY5jyetkiB9zyuTKkyX/tVqpCmoBa 1gXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=P/K/b2uuLQGUWkG9/6LQL74JjltLx2Dkm9LzHaacj2s=; b=D5Q4G2qvcyIcyTk0/sC8JTWIA4SzIHwh9L92n19Qa0Ixk7FV5cDROYRrI2tQ5hcWyM 9ZgNooYTMu0/hz4peZ6fkqV+80EAEnz0VcmN2sXtSefDgRO8V2VwC+TM/sY6HfcZwiiP Ul4sM/Sw6mF8vSCj8Neq43CvuXRqg+Ie6nZPDQDHoxlGahJCYUu0+hMA7ZES6+0a8V5o uKIhNoxlFgAzKCOseIDwnvBuq2jfRhjVQKVEBb+YD0E09yO2eTXfmDZqQZDIssaGOeco YC+vceYvStfLbSyOCKcIU59pomvP5khX9E1VFLdluPROfPiMbyqSfsj4YY7h0Ab7fu32 C7hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Em5RV/Y+"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f21-20020a0564021e9500b0045c3f6adb7csi3382705edf.215.2022.11.18.01.12.04; Fri, 18 Nov 2022 01:12:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Em5RV/Y+"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241436AbiKRJET (ORCPT + 99 others); Fri, 18 Nov 2022 04:04:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241530AbiKRJEM (ORCPT ); Fri, 18 Nov 2022 04:04:12 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C3F41143 for ; Fri, 18 Nov 2022 01:04:10 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id B6F99B810DF for ; Fri, 18 Nov 2022 09:04:08 +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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.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 -- 2.38.1