Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1121325rwb; Fri, 18 Nov 2022 13:07:07 -0800 (PST) X-Google-Smtp-Source: AA0mqf4GT+3jfY/DKaNUhEfgnfKhuse8R4f8pSGZlCHxWmSCMv0AnoZqgISsLyVTkx8NUlV7fhhF X-Received: by 2002:a17:902:968f:b0:189:5a:156c with SMTP id n15-20020a170902968f00b00189005a156cmr1024271plp.103.1668805627025; Fri, 18 Nov 2022 13:07:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668805627; cv=none; d=google.com; s=arc-20160816; b=RBXNxHPZ7WFytJ8yf/DbS/SDUeNT7J9aCiIIDtU+IrWk8Y56F5PutSBD0yQtKgdYaN ZEsS/HtAdY2/S91AURfbjQooZx9LjcQJRGsGNhZ+r72WC/4P4T9C0iGb9EHHTM3oNIgR l2ZPPgHCx9QqG0CwdrPNVN9ZuTEMBC5LhyvettATCMpMra7XEpG7gqCa+WYv/bpRjOAs oF+504xevRxI0XW4toHyDM1Q5AU/6aY61f6l4ta09yeW64eo1JZoc2rsUfKrK0SeI2cN Fu6cReAu08BAzOigjIbEhaFQDgizt4tKoAH5hks69C/UqBSP6giIdLvLUcp+D1XWxMhR HQkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=4epwfWNAzokGySOk696EuwX6VQFGPzhxiCCwLrWo4K4=; b=wklxYLKyoT4+b7R7Pa5aSNIPQSBFFdPUXCveGaspLDiI8kw4p52sXKMacESFwbaYMi cbyGdtl8bMXOQnRtuzGZsLmklDw4phkDk+QlskKWhqVcVPKqjMLQC0/FFYaAr89zUxdO VWSlMj/pTwrBLlgwEdazUrzt08u5SKInSByj+3UOSCN0sDNisQP7uEgpL5dFWcJhyYoR BIPm7q1un5dwH6BGfJgwk7euNSZL5IErAG+m1pAOX1RMUxSqn2efATseYCkhv/+EwDx6 soruOUFNU4mWO89Qr+R2+b2fWUfrWR/5yAo/akxiaZtAkLrj683jRIWBSczkZT7itZUh riHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=lvh+5iqn; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id il7-20020a17090b164700b0020d5867aab6si5429623pjb.141.2022.11.18.13.06.53; Fri, 18 Nov 2022 13:07:07 -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=@google.com header.s=20210112 header.b=lvh+5iqn; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229483AbiKRUxm (ORCPT + 99 others); Fri, 18 Nov 2022 15:53:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbiKRUxl (ORCPT ); Fri, 18 Nov 2022 15:53:41 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2AA71DA6D for ; Fri, 18 Nov 2022 12:53:39 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id i29so1254217edj.11 for ; Fri, 18 Nov 2022 12:53:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=4epwfWNAzokGySOk696EuwX6VQFGPzhxiCCwLrWo4K4=; b=lvh+5iqnoeMbqTOFUgRekkXgzoI+MUVzPn1tcdkSUgSKJQztDaC9tgv6JTyqvzjPCt 6QCeOhOH4wIoMK/GqZiqfDRZI9yBFwxgugjWlGIjJleqRSbdDRZuwJv6432mSI4Vh7Ng FtBkZLFRIa6BR67JUByTGzkaN+ZlupUogRSrONV+tmalD34zqdxq9bjNqJkdKqPELQXq Bh/fej5k0CLMb+XHbmPO36AsHDdJogbYvdj3qAlKkcVs7aUMONgaTeBaSebNbMPvZWN+ sHtlJZRvmqW5i2XIh0Ed/+tkw0nQMLKzC8ksZSDS2uhT1bNxY7W4W1X7sXeS4odbfRts phVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4epwfWNAzokGySOk696EuwX6VQFGPzhxiCCwLrWo4K4=; b=buAe75FAkUN6x598TDx1FWaqRsxr0OtBDwwjynTtHcY5ZoJULAILlPCAkgLcbc4RYp F+tz/jGaANZ94U4BaDRRu8ghYaAOcP6BS+4v9TP1uK0vfapbK+IZoc2XzmQK+Io/TZ5+ 1TpPV4x/mAXlKQ8RNDlMfpqTYspC5bOtNq8o/0stqTg+tEXhAroA6IrR7v3nt7dIcf6u GWP6xkDZqJWUWxqntyz7CenEWrZNKfYkuBiMbdoL5MMpWnWRQMtyBIEGmM1h2AAE3ax9 GulToFPbDx+nW89LAwti0E0OASLh/ZfkET2vZSY2EHUXDY+kNsU1wMyE+U4GgxY7HB47 +mLw== X-Gm-Message-State: ANoB5pkXYXE0Q14EPVtoHQXPvUlzBEGpPGKpg3P+jMsZ+sC2w64scW+q qpt8PeO1HbtBPJabh9/ueGsf9Of1J17n7F7fyFM3mg== X-Received: by 2002:a05:6402:3893:b0:461:b033:90ac with SMTP id fd19-20020a056402389300b00461b03390acmr5885951edb.257.1668804818395; Fri, 18 Nov 2022 12:53:38 -0800 (PST) MIME-Version: 1.0 References: <20221118194421.160414-1-ebiggers@kernel.org> <20221118194421.160414-9-ebiggers@kernel.org> In-Reply-To: From: Sami Tolvanen Date: Fri, 18 Nov 2022 12:53:01 -0800 Message-ID: Subject: Re: [PATCH v2 08/12] crypto: x86/sm4 - fix crash with CFI enabled To: Eric Biggers Cc: x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 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. Sami