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 X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BC1AC433DB for ; Thu, 25 Mar 2021 23:29:34 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF94661A21 for ; Thu, 25 Mar 2021 23:29:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF94661A21 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RfbAZBMC7iKmwMIqBoYBv/h/ns+ZcvXuQ894IzyrBrw=; b=OZ2dtE5eMEJjJEReVUx4+t+Gk WefilS7fJbCwVRQYp3dMkwUv+WVKBEop6kt858Lepv/vQ8c3ovZmVNLPqiRZD2MhhMc4qMiuE/tvJ xVPwEKDAGUrOpivX8RT2CWHWpCoZOVJgpw2DmYMoGSTN/aC/xercfBfLBV5RAb2Wl3iHU+XHOAwlF tRrt1kqPLB7gBPiyfUglcCHImKwFawH2sUQq+2XCtOyo5M36A9K52fB29uH6ciIfXcYiQMQKsEg// IBLNr935EziUCH+LyILbjbn4SXBVt9eQSFQbcOGx9j2Jau1Qc0u2864BvNHVF6a0qiZOG8JsuvsdO SnQnEnvmw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPZOb-002Mf8-0M; Thu, 25 Mar 2021 23:28:09 +0000 Received: from mail-vs1-xe2c.google.com ([2607:f8b0:4864:20::e2c]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lPZOW-002MeL-9T for linux-arm-kernel@lists.infradead.org; Thu, 25 Mar 2021 23:28:06 +0000 Received: by mail-vs1-xe2c.google.com with SMTP id b5so1805205vsl.9 for ; Thu, 25 Mar 2021 16:28:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sMIbLViyZj8/HlFK24+Kb6qHIJjqUM2GzqLOFEtB9oc=; b=L88zRiGVrc72dQhmDgR/gl8qiK4rX7wM+JKPd8gbrtbUdlgOq2qWt3hK/quHaVP65Z bO4L3tHQpHfPaRVNRTTnhWNEDjMxu1A8FIfWK6N3BgKWI7s/X8tWJ8JR/RN2kkJVQhtS s0kCqEIXJIfEpxWuw2lb+ancWufqeGs6cNlvu5zr1OPdoN77VELBfuVwv2098G1gVR1W qLssJpMKWs+sQI35oQtwqkRZkSmOqgSPEwWfmGUGgOs/3NzBSWZ7JE5XtmxzVrvSmrTS gbGr91kGamtH5beo2ZAoGW55Z6UpbyOfe0e7CVs3RKgb/23UoHpUO9eD2rAPuR6LB0Lr b6JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sMIbLViyZj8/HlFK24+Kb6qHIJjqUM2GzqLOFEtB9oc=; b=dSyAjyXH2bkrOtnub+C1p9BNS3iL8d9gbMgRIrGnwlvLsV3Fil6t1MLaRa//U9g3dS f99Iuv8ZSYA8N9MOFgxheB7eYMfPIaGhCQtsoeIEGzPCeK5hGJlM7jxu9AZXp4W0QjbB Hm4tj9ayrHIPCQwYXoiCY6kUyOmADEPd8RW0I5kICEB5eGtbIK59usUDbXEHV/iLI1pb tjQMxklyTrNzqk4aVZ2Q3zNraaVEv79ij+P+U2viBBKupzQ//XnDkDKODPmRkt4gwEMf Lnz6xjVn6q9B+cJeygOTj+60QVwOVFSGWL0GG6g+oEv64nU6lpxvc1P1rLg3uq1QU5LY mGTA== X-Gm-Message-State: AOAM532ep4ixLAYk/bUeWHcTbwHUo/U6cMI3jmWiYESaeFi9dTiG1aVf 4IdDSC0I60kIzGYDPUntDbs/gdeLD0PmrNNtzi09/g== X-Google-Smtp-Source: ABdhPJzXZpIDBEM17dpJFRhj46QNwU1LqTcjFes5q+MSMb/XfPVQl0PcMMMDnIa0KNr2ybRRsJDqEF2yBb4XZozL71I= X-Received: by 2002:a05:6102:a49:: with SMTP id i9mr6830290vss.14.1616714882733; Thu, 25 Mar 2021 16:28:02 -0700 (PDT) MIME-Version: 1.0 References: <20210323203946.2159693-1-samitolvanen@google.com> <20210323203946.2159693-13-samitolvanen@google.com> <20210325103757.GD36570@C02TD0UTHF1T.local> In-Reply-To: <20210325103757.GD36570@C02TD0UTHF1T.local> From: Sami Tolvanen Date: Thu, 25 Mar 2021 16:27:51 -0700 Message-ID: Subject: Re: [PATCH v3 12/17] arm64: implement __va_function To: Mark Rutland , Peter Collingbourne Cc: Kees Cook , Nathan Chancellor , Nick Desaulniers , Masahiro Yamada , Will Deacon , Jessica Yu , Arnd Bergmann , Tejun Heo , "Paul E. McKenney" , Christoph Hellwig , Peter Zijlstra , bpf , linux-hardening@vger.kernel.org, linux-arch , linux-arm-kernel , linux-kbuild , PCI , LKML X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210325_232804_420750_B0532500 X-CRM114-Status: GOOD ( 22.05 ) 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 Thu, Mar 25, 2021 at 3:38 AM Mark Rutland wrote: > > On Tue, Mar 23, 2021 at 01:39:41PM -0700, Sami Tolvanen wrote: > > With CONFIG_CFI_CLANG, the compiler replaces function addresses in > > instrumented C code with jump table addresses. This change implements > > the __va_function() macro, which returns the actual function address > > instead. > > > > Signed-off-by: Sami Tolvanen > > Reviewed-by: Kees Cook > > Is there really no attribute or builtin that can be used to do this > without assembly? I don't think the compiler currently offers anything that could help us here. Peter, can you think of another way to avoid the function address to jump table address conversion with -fno-sanitize-cfi-canonical-jump-tables? > IIUC from other patches the symbol tables will contain the "real" > non-cfi entry points (unless we explciitly asked to make the jump table > address canonical), so AFAICT here the compiler should have all the > necessary information to generate either the CFI or non-CFI entry point > addresses, even if it doesn't expose an interface for that today. > > It'd be a lot nicer if we could get the compiler to do this for us. I agree, that would be quite useful in the kernel. Sami _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel