From mboxrd@z Thu Jan 1 00:00:00 1970 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 2C127C433FE for ; Fri, 18 Nov 2022 20:11:20 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=58tV3g3l5bWrhQyPIKY0EA7fDsfQPXUR+PrHib7ARwc=; b=Rs+e62xTU5l+XJ c6HNvMb9o+ZcxIK01xxUAICB8aNq3iSB9EjHJTB7k1ravZcxg24KpOUNWcAzSaCtKp01yDmDMvZgg ta4ZJMyF639ZD8c7h8CfUR9sZN7+wKFNJaM3GwEhyV5YiMypQiNO9xsqAJZTnoDzfSLHKSUtgmyku e8LhDDqgVB6Od8XJVbwj2UXuUYQu+Yvc5jTna3Gf4KtAkG8Vw6b4A7aW+NrX7hQkiHGQpHW8aLn/t S4cQMA1bR13bq+bokbZ1Kq94vt+HOfsYsUulGS6Zl1oJCfmrNRA52da2a8lcC1J5pV+DMz1GCOdcx tJYcywH9yK8/YGyEYmrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ow7h2-007rw2-EU; Fri, 18 Nov 2022 20:10:32 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ow7gz-007rv5-Vv for linux-arm-kernel@lists.infradead.org; Fri, 18 Nov 2022 20:10:31 +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 5C4F562766; Fri, 18 Nov 2022 20:10:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99655C433D6; Fri, 18 Nov 2022 20:10:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668802228; bh=g15ZgYIyqqNcWivqUSAPRmX9RwX9KtdnWWwsroGLpB4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dY0poglitAuL6oX65nW17ZRSUcrUf7Lh2egtvRB17q91ikFzAeCqKYD5teJ5h7vHS AH4Pmu8RrJFTU5FW9mh0RwvwNia5IlP7yNNe5sYwzzikYxmxC7UvS2fx7Ozlca49Yi VL8FQh6hIO8gMcInwprkXZqVKQo7n6QpXuV3B2YN0SGIy9V+pT1N1xojrVX6Yslsz9 /j/WW0sM2KCTeFYBtbweciYvctODMylX859uyyMkcZHklZ5W1id3nrvoXDQOq3zYne I7ea8j1kTiKGMel9AGiYe/DQ79fa4sAE1NAMwgE8jY/mWEp2A3diQ1t3VUkiC10KDs 5LG67XzlYRnMg== Date: Fri, 18 Nov 2022 12:10:26 -0800 From: Eric Biggers To: Sami Tolvanen Cc: x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org Subject: Re: [PATCH v2 08/12] crypto: x86/sm4 - fix crash with CFI enabled Message-ID: References: <20221118194421.160414-1-ebiggers@kernel.org> <20221118194421.160414-9-ebiggers@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221118194421.160414-9-ebiggers@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221118_121030_085450_F65B6C78 X-CRM114-Status: GOOD ( 14.84 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Nov 18, 2022 at 11:44:17AM -0800, Eric Biggers wrote: > From: Eric Biggers > > sm4_aesni_avx_ctr_enc_blk8(), sm4_aesni_avx_cbc_dec_blk8(), > sm4_aesni_avx_cfb_dec_blk8(), sm4_aesni_avx2_ctr_enc_blk16(), > sm4_aesni_avx2_cbc_dec_blk16(), and sm4_aesni_avx2_cfb_dec_blk16() are > called via indirect function calls. Therefore they need to use > SYM_TYPED_FUNC_START instead of SYM_FUNC_START to cause their type > hashes to be emitted when the kernel is built with CONFIG_CFI_CLANG=y. > Otherwise, the code crashes with a CFI failure. > > (Or at least that should be the case. For some reason the CFI checks in > sm4_avx_cbc_decrypt(), sm4_avx_cfb_decrypt(), and sm4_avx_ctr_crypt() > are not always being generated, using current tip-of-tree clang. > Anyway, this patch is a good idea anyway.) Sami, is it expected that a CFI check isn't being generated for the indirect call to 'func' in sm4_avx_cbc_decrypt()? I'm using LLVM commit 4a7be42d922af0. - Eric _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel