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=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 7BB36C43332 for ; Fri, 12 Mar 2021 02:48:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6763164F94 for ; Fri, 12 Mar 2021 02:48:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231468AbhCLCsN (ORCPT ); Thu, 11 Mar 2021 21:48:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231700AbhCLCry (ORCPT ); Thu, 11 Mar 2021 21:47:54 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F2FEC061765 for ; Thu, 11 Mar 2021 18:47:54 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id x7-20020a17090a2b07b02900c0ea793940so10058906pjc.2 for ; Thu, 11 Mar 2021 18:47:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3pbYYGaj80nmpPvKAoi7nhvjG8dX/laYbfFgJvGfe3c=; b=TVvY3uWHgNwAIsZEgnbifL/pc30apYHHTufaQZzVegGdzliIuHgvA8Nbd8Lrll72FY KFmxKs8QqhJcSAjCd6mlI3lKltRekuyYpF/AgZJ6+fCknS1tomIK1kPZGVB92pEeZEVp 3UjOXcbS9ZxbdtV8l7DXBsqnx9hkNEYwPcarI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3pbYYGaj80nmpPvKAoi7nhvjG8dX/laYbfFgJvGfe3c=; b=X9ie2b+447FqzPGItyzUbGakJkcs5TyHbH5p+czNmcF6+6DweDav7iquM95x/qwowh NBn4FDjPApG7eo1ZiP+PfLklwZI+pzoYI77tm3PQnU8HQU5b4hHI18pfsXWqCPrrvE4R EHQf+4qna8Zb9/jLV5M9iIUbaLnSPiDkz1ZmZAZABAScbD0A/z79v8EcFCdMHNxCMsx0 BOms6lU7EAU9CCP8LE1O0Bm8G0hfmSQRZYaTeq1HXC1a5s7/QFR23RjIcIy615UrhXji zOxwyv6BT38Qtazf6+XoFW0aNlsL1SSe/wDl46ueTWbRW7D3vtzanVk2vXaDaDa3f0aL 5DOQ== X-Gm-Message-State: AOAM531GKCyOto/24Dt44mCd2GeCocfkYsKGd3KTwis4V16P5YUWl6IB YepmuFquWoXnYMISd7jdgvpwIw== X-Google-Smtp-Source: ABdhPJxK8F7zRzFG3Hv59fvgnwRI+OZARJnDoK1+LfDL/LiWLtBVkDEva8AoU4vTLsGb4IOwAup2lw== X-Received: by 2002:a17:90b:f15:: with SMTP id br21mr11959110pjb.234.1615517274302; Thu, 11 Mar 2021 18:47:54 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id d24sm381554pjw.37.2021.03.11.18.47.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 18:47:53 -0800 (PST) Date: Thu, 11 Mar 2021 18:47:52 -0800 From: Kees Cook To: Sami Tolvanen Cc: Nathan Chancellor , Nick Desaulniers , Masahiro Yamada , Will Deacon , Jessica Yu , Arnd Bergmann , Tejun Heo , bpf@vger.kernel.org, linux-hardening@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 14/17] arm64: add __nocfi to functions that jump to a physical address Message-ID: <202103111847.0EC7EDBF@keescook> References: <20210312004919.669614-1-samitolvanen@google.com> <20210312004919.669614-15-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210312004919.669614-15-samitolvanen@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 11, 2021 at 04:49:16PM -0800, Sami Tolvanen wrote: > Disable CFI checking for functions that switch to linear mapping and > make an indirect call to a physical address, since the compiler only > understands virtual addresses and the CFI check for such indirect calls > would always fail. > > Signed-off-by: Sami Tolvanen (I wonder if there is some value in a separate macro for "makes a PA call"? Might other things care about that besides just CFI?) Reviewed-by: Kees Cook -- Kees Cook 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_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 8C90FC433E6 for ; Fri, 12 Mar 2021 02:49:36 +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 037A464F87 for ; Fri, 12 Mar 2021 02:49:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 037A464F87 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org 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: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=V5je5cNpsGfqPIvvx9eN8ktaqF8lxoU1/+1mxynSFGM=; b=TbS0UGTL6QBmXHMP5BgpK7lJ3 owKdDhhxvP5MJcBrxKuzpAaK99do6MawUQ+dW0LM/7tb+gpDG1Q2xf4vhfHuWeMB/E0yCnk6ihlXQ rRbDYDO6ISrsiGdwsCmVe+P8TPBIYZJ/I2tRE1gRFpCCATP4lcR/CAz3SY112/fRhANBP9SL4Bj36 xyFvz7VBZqFhXTpi89cAjhng+X2yyE34X4juTkhAg8GdMz2u5bkyYHfiFgXcW2If1vHbmyt4DQx4P 14Bu5t68kR3amZt4vmBgTb2YyO8qs7NWKceV2sItsHu0rfsZqDLPLj5dNPpCsXE1APMC/bDlGLlag TKroFSMBQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKXqM-00AVvV-HP; Fri, 12 Mar 2021 02:48:03 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKXqF-00AVsf-Ve for linux-arm-kernel@lists.infradead.org; Fri, 12 Mar 2021 02:47:58 +0000 Received: by mail-pl1-x62c.google.com with SMTP id n17so7666994plc.7 for ; Thu, 11 Mar 2021 18:47:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3pbYYGaj80nmpPvKAoi7nhvjG8dX/laYbfFgJvGfe3c=; b=TVvY3uWHgNwAIsZEgnbifL/pc30apYHHTufaQZzVegGdzliIuHgvA8Nbd8Lrll72FY KFmxKs8QqhJcSAjCd6mlI3lKltRekuyYpF/AgZJ6+fCknS1tomIK1kPZGVB92pEeZEVp 3UjOXcbS9ZxbdtV8l7DXBsqnx9hkNEYwPcarI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3pbYYGaj80nmpPvKAoi7nhvjG8dX/laYbfFgJvGfe3c=; b=Ysh13aZ/vOCMaJDd0edfR3Ax24CaAOFsS874R7/Hh1UiQFMuGHoSqROG+LydLX/rup R02dNOya+7tbOsIQXpsIJyMQBQR+BUlvq7vUDGUdLstzlsRWKgdAvi3yCiWTB6pYIHoU DFT9cZRmiKr0jLx7ACnpTnI1pU8r1V/Zc7aL6CTDMO53cslo+4AKe3oICiwjCoOOl+Lb wMpev3SlTlxCiDskC1QGGtbb1t9/7DrNf3pHkkHkbZuWI/9xUg16O6mP7z07fGyJUOKB M45SpGWNY09Ryym3JGWYY+165XT1qLsijNiT1FwEPV2vSiQ13y2zJXMjuem+25VLiTNR hNhQ== X-Gm-Message-State: AOAM530RdHCFVutIl58R9BNdWlVFJrQTVW40PTWdUjelcgNoC077R/Uu +RDkQotrqLJTFbABPCrXE89jCg== X-Google-Smtp-Source: ABdhPJxK8F7zRzFG3Hv59fvgnwRI+OZARJnDoK1+LfDL/LiWLtBVkDEva8AoU4vTLsGb4IOwAup2lw== X-Received: by 2002:a17:90b:f15:: with SMTP id br21mr11959110pjb.234.1615517274302; Thu, 11 Mar 2021 18:47:54 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id d24sm381554pjw.37.2021.03.11.18.47.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 18:47:53 -0800 (PST) Date: Thu, 11 Mar 2021 18:47:52 -0800 From: Kees Cook To: Sami Tolvanen Cc: Nathan Chancellor , Nick Desaulniers , Masahiro Yamada , Will Deacon , Jessica Yu , Arnd Bergmann , Tejun Heo , bpf@vger.kernel.org, linux-hardening@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 14/17] arm64: add __nocfi to functions that jump to a physical address Message-ID: <202103111847.0EC7EDBF@keescook> References: <20210312004919.669614-1-samitolvanen@google.com> <20210312004919.669614-15-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210312004919.669614-15-samitolvanen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210312_024756_375622_800E3432 X-CRM114-Status: GOOD ( 11.77 ) 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 11, 2021 at 04:49:16PM -0800, Sami Tolvanen wrote: > Disable CFI checking for functions that switch to linear mapping and > make an indirect call to a physical address, since the compiler only > understands virtual addresses and the CFI check for such indirect calls > would always fail. > > Signed-off-by: Sami Tolvanen (I wonder if there is some value in a separate macro for "makes a PA call"? Might other things care about that besides just CFI?) Reviewed-by: Kees Cook -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel