Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp287989rwb; Fri, 18 Nov 2022 01:12:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf7BAMxI+NnUhzP9ZvU97G3Mf3j+G5wNf3cETIFcbKZGEQK8us4ZwE+3Q7F/ahbg/9+I9z+3 X-Received: by 2002:aa7:cc04:0:b0:463:1a0c:4dd1 with SMTP id q4-20020aa7cc04000000b004631a0c4dd1mr5518943edt.137.1668762752272; 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=GgW/dYELTyEwtYDIXAhL0MjguraTcC1m7/uRm1fNrF/GFU0L0/WGqwWbnj6EvC20JV obWUEe4r2bdysWjijtnZhf9mdWEbsGLmj+Nu7/hDlRbZ49V/O/dOnLrQFeBOFKLVYl2W lhp9mWqlsxweeagEKG7uY4zsNClfmCIz8yz4R+aRK8TBMzax5BSdLkQEuofNiUO1EM3R VgOkaxlXdkLaTjeQwD10mgJsmqpHHDMovlcG/ncEbsr596HhLYvyaBzcNKRgviRA7FmK g/F7UrzR5+hLJgopNrwrg7Nz2kHVL5N5NhM9wooD4E3RtnmMbTjbSFTlwi0qW7R23VYS MS9Q== 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=czxUQ8T7fs++j3RA2FZbcHFKggSXIwvb3aZzf/yWAFo=; b=gh34dFH/j3gK10QSBH1MhUhjDWC2yfLWoyWkwSTXwTccKq/pqZKmr/1ZwYZxLVvK5e mTZ06Jjm8TzlgU/MpqbZOLw4b7a102dnpGipNeOD9zqVWMmzGXv61MzPnVOg/BCK63rH 1qQMrZLxfVsZZK59XXzxZWYNfdBT1g8gfLdnNjHCg3o4TrqYVOZ4bwqfAHWhWACYGAJS 2Lf8ap+e++habWChLYvKWy+9TBonZ0jNuPXdEJckNndO9sC/VhNQtZ0n45jLiKBbu7Wo gbFWp3mk8KySFU363YR6u7f28vto+kHA3f7wHGT5LM8N/Z+Qo9wmZI8y4fC6DdN+mCc7 rMlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NjtJJyf8; 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 t18-20020a1709063e5200b0078e1d213812si2104222eji.184.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=NjtJJyf8; 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 S240803AbiKRJEL (ORCPT + 99 others); Fri, 18 Nov 2022 04:04:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241455AbiKRJEJ (ORCPT ); Fri, 18 Nov 2022 04:04:09 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAF101143 for ; Fri, 18 Nov 2022 01:04:08 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 3F0346230C for ; Fri, 18 Nov 2022 09:04:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DCEAC433D7; 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=cS7/6QLD7TgC3YuEBW48zGmDobm+o6walAidsI/8OGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NjtJJyf8H7nZ96eNiOfXsu5McNg8JK5zV0FckJdxHo8dDY1NKgZewBSzMQLrYjZf3 SQqLbctXfcuL4XCZjEr4uavRjOYolvNXe42Abn/F/cnd3krlFwnTV45bfevAgH6lz2 80E4RvUb7RkdTzZHOgTv9LEbCVnQYW0qTa5lV++HqJfze5XVfPfOnukxyMG4ZvZP2c bvzL0z1nrfFSUJBVT39wzLqEq/rW2tK3pLR02zpLG/l4Ft48+lkJZwRcrj2jM57h2g SYPkpj0gY3Jbwk2oLs2tE28qGg4wJ32KKjk+N+YhFwrqqWe0BdS2uJe0A5YH6UVcba jS5k7ZOOtX3ZA== From: Eric Biggers To: linux-crypto@vger.kernel.org Cc: x86@kernel.org, linux-arm-kernel@lists.infradead.org, Sami Tolvanen Subject: [PATCH 01/11] crypto: x86/aegis128 - fix crash with CFI enabled Date: Fri, 18 Nov 2022 01:02:10 -0800 Message-Id: <20221118090220.398819-2-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 Some functions in aegis128-aesni-asm.S are called via indirect function calls. These functions need 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. Fixes: 3c516f89e17e ("x86: Add support for CONFIG_CFI_CLANG") Signed-off-by: Eric Biggers --- arch/x86/crypto/aegis128-aesni-asm.S | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/x86/crypto/aegis128-aesni-asm.S b/arch/x86/crypto/aegis128-aesni-asm.S index b48ddebb47489..cdf3215ec272c 100644 --- a/arch/x86/crypto/aegis128-aesni-asm.S +++ b/arch/x86/crypto/aegis128-aesni-asm.S @@ -7,6 +7,7 @@ */ #include +#include #include #define STATE0 %xmm0 @@ -402,7 +403,7 @@ SYM_FUNC_END(crypto_aegis128_aesni_ad) * void crypto_aegis128_aesni_enc(void *state, unsigned int length, * const void *src, void *dst); */ -SYM_FUNC_START(crypto_aegis128_aesni_enc) +SYM_TYPED_FUNC_START(crypto_aegis128_aesni_enc) FRAME_BEGIN cmp $0x10, LEN @@ -499,7 +500,7 @@ SYM_FUNC_END(crypto_aegis128_aesni_enc) * void crypto_aegis128_aesni_enc_tail(void *state, unsigned int length, * const void *src, void *dst); */ -SYM_FUNC_START(crypto_aegis128_aesni_enc_tail) +SYM_TYPED_FUNC_START(crypto_aegis128_aesni_enc_tail) FRAME_BEGIN /* load the state: */ @@ -556,7 +557,7 @@ SYM_FUNC_END(crypto_aegis128_aesni_enc_tail) * void crypto_aegis128_aesni_dec(void *state, unsigned int length, * const void *src, void *dst); */ -SYM_FUNC_START(crypto_aegis128_aesni_dec) +SYM_TYPED_FUNC_START(crypto_aegis128_aesni_dec) FRAME_BEGIN cmp $0x10, LEN @@ -653,7 +654,7 @@ SYM_FUNC_END(crypto_aegis128_aesni_dec) * void crypto_aegis128_aesni_dec_tail(void *state, unsigned int length, * const void *src, void *dst); */ -SYM_FUNC_START(crypto_aegis128_aesni_dec_tail) +SYM_TYPED_FUNC_START(crypto_aegis128_aesni_dec_tail) FRAME_BEGIN /* load the state: */ -- 2.38.1