Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1210058rwb; Fri, 18 Nov 2022 14:39:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf5RuJRkOtrojBQ8hCTjxqLjAjv4OsJ8nTkIjnzkMBqlx3yQvceiMpLicBeKzBkCrjZEVVp9 X-Received: by 2002:a17:906:5fd5:b0:7ac:2e16:a8d3 with SMTP id k21-20020a1709065fd500b007ac2e16a8d3mr7949022ejv.667.1668811157171; Fri, 18 Nov 2022 14:39:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668811157; cv=none; d=google.com; s=arc-20160816; b=bFFdHa5V6cGwF5BhlQ868ElWzsWnPYQpAOPY9zmqsVHkv9MPYUv27tCyiZK7eDfaIw YTn5R26KWGCdNYqoGxAoF6kN7fRgJ23AGTS9FylB7t1vY0VpBcwsYFW/XWvrGhIxDhcV eZGaHgCCLUJ/yci4DEGO2sBBnXR25Y5DTM0a+qsBd/DiYn5dfCxNRHXkfq2+H8nANDp7 LQVyOrnzn4GwW4JtpsHi9geDs/4pIwdnOrjriAvdt8fMgcRwauxuYxDEZ3lNli5I1S7B 1n0zvOktmV+uXgYLXNjfjPFW31ww32NNJkfcDDi9YM/L5GuZFeuhvUaqRiAKBcyAK87F vHTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xWKkvD7JiScwYHFyZwZHHUmdEuPvTXW8Q0c82NbPO5o=; b=ZxZw4UrhfvqydzkJCmYunbLzV6n+FJ9B6n/aHlIzbLpD8vonhX7ClaO4uKu/Wf3X6A dUXXOxREwXJhcdR59t4XTbhOomWUbu1tiOI7v/Wqm9lGZL+9oz9P6yn9+JFnZN4GssTd +8nqqWsuYCjVFVlqZHONcYYO7Q6yrdQZMGC1NRTK5LUJ147V+ays6LPUAiDOa1wjT2ey 5cO80QOttG1u3+tF0KgzRfxKYR1Rg5uo2vK9IyiGcBcka9fRtf8tx8BFNqeXYSrJSyqL 56Nvkl1FvWkcIAyZvBSW0NkUKrne7iYeORvUhVG8oT3oTO15pPgNYn6nF7akNyw4hLnH 2KLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bpbVUy56; 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 fj4-20020a1709069c8400b00782da4ff18dsi3884807ejc.668.2022.11.18.14.38.46; Fri, 18 Nov 2022 14:39:17 -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=bpbVUy56; 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 S229677AbiKRWdQ (ORCPT + 99 others); Fri, 18 Nov 2022 17:33:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbiKRWdP (ORCPT ); Fri, 18 Nov 2022 17:33:15 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F349A9ACA2 for ; Fri, 18 Nov 2022 14:33:14 -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 9472F627A9 for ; Fri, 18 Nov 2022 22:33:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A41DDC433C1; Fri, 18 Nov 2022 22:33:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668810793; bh=Qn+bhuDN4Uq8dMdeJ49qjwh7QjWi1Pb6Ow16TnENIWA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bpbVUy562ncoA0HYnNrkzFAXqmO1O2ZdgN+kbR68FqT/zXa2/ZmYb/rVaLBQazQs/ VgBAISIoPdSvt9JkDstJt3HHXV4jXMwC8NtxnMzIzAOdoO7Qgg9PzVS7gNGhjoiIuw XR/8cMtIYY7Sw8g1+8gmEYZYVNjUwh5TyU8R4AmpQKjSZSdE8zcYkAcDBRRGxWKGC0 v3XqIaTT9xCgv705L+OFHRBvh/Fd2LLbHopZDKEJr+gVcFoXyNDe1Kqxph+2eHbvlO 8aMF39mCgq173Fne5KXHYKqTeU1DLiZ+1ot26LQ3rXwydu7xArgGIFSxVK0r47lRK9 p/Jxzvto51wTA== Date: Fri, 18 Nov 2022 14:33:11 -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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Fri, Nov 18, 2022 at 02:01:40PM -0800, Sami Tolvanen wrote: > On Fri, Nov 18, 2022 at 12:53 PM Sami Tolvanen wrote: > > > > On Fri, Nov 18, 2022 at 12:27 PM Sami Tolvanen wrote: > > > > > > On Fri, Nov 18, 2022 at 12:10 PM Eric Biggers wrote: > > > > 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. > > > > > > If the compiler emits an indirect call, it should also emit a CFI > > > check. What's the assembly code it generates here? > > > > With CONFIG_RETPOLINE, the check is emitted as expected, but I can > > reproduce this issue without retpolines. It looks like the cfi-type > > attribute is dropped from the machine instruction in one of the X86 > > specific passes. I'll take a look. > > This should now be fixed in ToT LLVM after commit 7c96f61aaa4c. Thanks > for spotting the issue! > Thanks, it seems to work now. (If I revert my sm4 fix, I get a CFI failure as expected.) - Eric