Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1160141pxb; Fri, 21 Jan 2022 11:07:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyS2jWST0kJ4BqkU4TGQ0gb7FymnSY06zoKikBeQW7eywJHZYLptk9CI9RrVgHx7FIw4/KW X-Received: by 2002:a63:82c2:: with SMTP id w185mr2512438pgd.16.1642792061121; Fri, 21 Jan 2022 11:07:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642792061; cv=none; d=google.com; s=arc-20160816; b=QtS/HRQRSG3CPdhEge8Qe/UzQtdYVjuvqJZxtP8c3OFQ4NSq5Or2Atp2mDG1Ca1nNU ykQajE5ks1KJzhLbDAY9LtLQIGyj1tT1oseoBJCQzfy1M+/4IKkwnIf+qTkOBVYGuoQv Q9lR+wmC4i/tWGBdBsPUnTEDiIqicf2a8j+FLRQNNUgfdVgNFNmW3wn5oS/e/UUHiafI K7WY1SScVSyEzValKcPLcLmbo7aKrRuTQKtC6yL9X5nv6v7rsgiPy9rg6/poNCz4f2dr im3rPk4+Wa7PCWtX3IIYNxLpKthERjY0dI3AfybjteNBlGQ3LQWR9fd7fiPGwy27tVNl TgoA== 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=1yUmZ1gtr9CBj5pMoqsvEIB5CbXXsyQeM7ffKKbaC24=; b=unjIOJ8gXUdSSrrm7CRJLAEZc+Y+5+LcHLsW2IeAxRDvQZ5XoFO0KgyitASl2l+Rqm sg835DYJTPSpXMwOzjxt2i/5agWpqTXuDdkno4O9/UM12Zi/iJRUPHOZbr4j0P2hir4j tdkTIl2lqh48Ock4y5IVp//hfUhVnwHPSbcBbWWci9393v51B9e9DwS4RkAhdPxGicid 5rBdBczDIDVLeXBcx/CCmKslGIY59iGAHGsMh/Dq/fyhTsKkg0kiDTExhUXW2DLUfpjA vgq/lvkc4CQcUyziSV7f7hEs9c1XlMfHLqvaxMzcsckE/7RwWX2XtlMZ8w28dDvlT4to f8+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q81WFpPH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si6378237pgk.399.2022.01.21.11.07.28; Fri, 21 Jan 2022 11:07:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q81WFpPH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1353493AbiASKNw (ORCPT + 99 others); Wed, 19 Jan 2022 05:13:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353474AbiASKNv (ORCPT ); Wed, 19 Jan 2022 05:13:51 -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 89CF9C061574; Wed, 19 Jan 2022 02:13:51 -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 3006EB8191A; Wed, 19 Jan 2022 10:13:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2CE1C340E5; Wed, 19 Jan 2022 10:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642587228; bh=1yUmZ1gtr9CBj5pMoqsvEIB5CbXXsyQeM7ffKKbaC24=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=q81WFpPHkZ7JV6ZOKutx3YkmR40mCv+CdMEBEV/oDqtHeIMtAqjMsI+Lusl40hoF7 LqRAw540lQZlb3gDjcnAMs6IKjNXYoc2D3wKozp/5wCOq+M/JPlLElqw0l+bIvdk5T nNv7bctlnKXGscv3xmuYtKXvaN5Bc1ceZ0tEX6AKAZ0PVl+hhouyzA5nvw2UKuP43W K4UabxmcdfsYryv0uIJ47AByUPXCN2kmAb+qFjV8E+g1tS4xzUf3gHME+56cKih0h7 VgeCDujJ3Dskn7NfyrD+AkhDqXLCoQIzNEFQo8waUrvJgGVL2f4FqAmm8gjls6l9VM YjvOnUbbsfGQg== Received: by mail-wm1-f46.google.com with SMTP id q9-20020a7bce89000000b00349e697f2fbso13319237wmj.0; Wed, 19 Jan 2022 02:13:48 -0800 (PST) X-Gm-Message-State: AOAM533Mge5F1gr664RRxeaIwqRdOOYv9K2gUkwV6V5mIUul6TayJtzm jRiR5XW+3jhkZWxrwbBnvml4C4gEfzvLuGWDkEA= X-Received: by 2002:a05:600c:3c9c:: with SMTP id bg28mr2689276wmb.190.1642587227212; Wed, 19 Jan 2022 02:13:47 -0800 (PST) MIME-Version: 1.0 References: <20220119100615.5059-1-miles.chen@mediatek.com> In-Reply-To: <20220119100615.5059-1-miles.chen@mediatek.com> From: Ard Biesheuvel Date: Wed, 19 Jan 2022 11:13:35 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] lib/crypto: blake2s: fix a CFI failure To: Miles Chen Cc: "Jason A. Donenfeld" , "David S. Miller" , Greg Kroah-Hartman , Herbert Xu , Linux ARM , Linux Crypto Mailing List , Linux Kernel Mailing List , linux-mediatek@lists.infradead.org, Matthias Brugger , Nathan Chancellor , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 Jan 2022 at 11:06, Miles Chen wrote: > > Hi, > > >Hi Miles, > > > >I'm actually not able to reproduce your oops. I'm using vanilla clang > >13, cross compiling for arm64, with thin LTO enabled and CFI enabled. > >Kernel seems to run fine. > > > > > >Are there other settings that are needed to trigger this? Do you see > >it in upstream clang or just the Android fork of clang? > > > I will try another clang (the previous version I use). > I am using Android fork of clang and there is a clang upgrade in this merge. > One thing that could be worth a try is to make __blake2s_update() and __blake2s_final() __always_inline rather than just inline, which by itself does not appear to be sufficient for the code to get inlined. (If it were, the indirect call should have disappeared as well) Given that indirect calls suck on x86, we should probably apply that change in any case, regardless of CFI.