Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp288226rwb; Fri, 18 Nov 2022 01:12:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf7z5KXoGU3TUivWIOfZVvytxFLurAkfv93cgfBzpTxbrRvlLlJJSeoZdcjLaAkUE2fJUb15 X-Received: by 2002:a17:906:144c:b0:7ad:cda3:93c7 with SMTP id q12-20020a170906144c00b007adcda393c7mr5318137ejc.500.1668762765588; Fri, 18 Nov 2022 01:12:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668762765; cv=none; d=google.com; s=arc-20160816; b=0w5UgH4Qo44S4k40EnWNEenebSDWr4glV/YcKj5gsigj04PZRb45qrIKij7fOJsx1w uQLiIEGqOp8ZlG1I6vre8iAMqnzhORxfYetOGGn6eYIBwVn0cK26uVSR6RS6BaOC9qAh GwSrHTfG1f8afDuwyX6KvKH9kEy0Ke77fymiDTp/8xCifydp2d0STVaMwA/s9vdKSa6x EWQpdou4H55oclKYXidlnb83Yq4DSDdZalWi49uInPW2st7qtPO8htR+0ayPgYv/S30O Sk6OvEtBCxhHdVkmTtzZaIDU8j/Jj5ebtFart6oFz9oh7i2Zi0a4HFJX2hEcUFx9/51Z 9NHg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MTkindJ8QREF24iHipq+M21lOgymP7qXFWr+r8qlt+s=; b=GgYOdQcOYj/ksQWlXnftkOG059CcmQDcyLovVWeG8u/DXGu2ajLvxkU2RugqzqBojw lzLcW2l7eyUIHoIKLwFoh1Eyx0okpc/MXx4/KRSY7EKJGQ8hXbtxggtO9mjklyTxAipa pCJfhUPVnCUY/Nzvpu8xVjwwuBOnX3YjexpOrJN8BEhmTavYkE6NshGqxDeUHrje+8Nr BliUMqZAS3Pp/Uaa3BTx5Q0aU89PZnal7YgixOp8ApTpcY+zSQeBCHHbb4z3J1H4M8EA tHeTxy5OBfGcsdAJMB1PcbNrlmPPek/BXqIaRGj0lvaYEFqqLurlhETp6Y58C9tW7stQ 5fRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NqABtUTY; 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 xg2-20020a170907320200b007adca6532d5si2451485ejb.708.2022.11.18.01.12.20; Fri, 18 Nov 2022 01:12:45 -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=NqABtUTY; 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 S241734AbiKRJEt (ORCPT + 99 others); Fri, 18 Nov 2022 04:04:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241715AbiKRJER (ORCPT ); Fri, 18 Nov 2022 04:04:17 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 971278A17A for ; Fri, 18 Nov 2022 01:04:12 -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 2E9EDB82269 for ; Fri, 18 Nov 2022 09:04:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C609FC433D7; Fri, 18 Nov 2022 09:04:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668762249; bh=wyK4erNXYZLb0gGezT+2lcL+zroMKoz8h7GycCvuO2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NqABtUTYY1aVx9PfXGJq58Dbdt7rDMgcoP+hSxU5ThNarF3tRMyvrwQwAEkXDGUO5 tiJ5U6LMLR0lV4JumLMkHK8INpJW3VIBKbH25sTBOZ87643hheINT8JJZJRVNf2TJF Avmp31f8rb9nVNMm7VPa6EXaX/IeeMYxx0SdXLQ4veF50FCyygcXgJzJ0h/mNWUiz0 nXsrpByKTHAWcFIFVyfqlGKRd3pquE2LM5zke5eFjTEU3S7TFTNO9O/gQ3AjOeWI8Y mPsBOdZcHGDb2+C+DgTlFSdpfjQy/mk723T/7DJTGcpPCtgOYlXcdr21Vaz+4C3FCr kxX8ORTboM8rw== From: Eric Biggers To: linux-crypto@vger.kernel.org Cc: x86@kernel.org, linux-arm-kernel@lists.infradead.org, Sami Tolvanen Subject: [PATCH 09/11] crypto: arm64/sm3 - fix possible crash with CFI enabled Date: Fri, 18 Nov 2022 01:02:18 -0800 Message-Id: <20221118090220.398819-10-ebiggers@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221118090220.398819-1-ebiggers@kernel.org> References: <20221118090220.398819-1-ebiggers@kernel.org> 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 From: Eric Biggers sm3_neon_transform() is called via indirect function calls. This function needs to use SYM_TYPED_FUNC_START instead of SYM_FUNC_START to cause type hashes to be emitted when the kernel is built with CONFIG_CFI_CLANG=y. Otherwise, the code crashes with a CFI failure (if the compiler didn't happen to optimize out the indirect call). Fixes: c50d32859e70 ("arm64: Add types to indirect called assembly functions") Signed-off-by: Eric Biggers --- arch/arm64/crypto/sm3-neon-core.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/crypto/sm3-neon-core.S b/arch/arm64/crypto/sm3-neon-core.S index 3e3b4e5c736fc..8abea1d39ddd9 100644 --- a/arch/arm64/crypto/sm3-neon-core.S +++ b/arch/arm64/crypto/sm3-neon-core.S @@ -9,7 +9,7 @@ */ #include -#include +#include /* Context structure */ @@ -351,7 +351,7 @@ */ .text .align 3 -SYM_FUNC_START(sm3_neon_transform) +SYM_TYPED_FUNC_START(sm3_neon_transform) ldp ra, rb, [RSTATE, #0] ldp rc, rd, [RSTATE, #8] ldp re, rf, [RSTATE, #16] -- 2.38.1