Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4559122pxf; Tue, 23 Mar 2021 13:43:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuVsq5RJ9B03/TMRZrFVktPbIUR1tu70yqM9YdeFWFozFZT0F0ENSBZwWXUO7dIM9UPV26 X-Received: by 2002:a05:6402:31b7:: with SMTP id dj23mr6484890edb.245.1616532225198; Tue, 23 Mar 2021 13:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616532225; cv=none; d=google.com; s=arc-20160816; b=ZZRy8wMWU8smqdO+9w6R+FkCeoABKL6gh+AJJpI3JPHxSk7Yy21ji5JAyuwkPS0RsZ uKlIZpdrLcczYiJBK6O6xoZHmE2JS0pnIPdAbRMzCnvBVRrtiityLl6PXvBgdmL9jhZ9 3Fgj3bSGOBpc+8dYUdw19AsbltdMcf4FAfzG9ClIGMDB0O+kWJufusREDjtRd/o8SSZk Kkn3PQK+FzNn7MN1ZJBTKz/HzlwDlA5jNx6yBe8+ZErYha2jzZISHwwj5ov8Gb2+9ymO 7oxDgw+NDJEvu32nFFT33lvp/hPKALEb5RS622QsqJmMBoOO0cNfAlzHjMRCtO6fvY/j glpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=tNWRsiiEAfetheYG6qtDYdd6Zu2YM8DJGmENfE26Aac=; b=RMIhkwwd4UJDRBik/u5+WkJmyXe/MdViHcU7N/WKUgy3BqugS5NozitKkc2S3zU8LB 0t6FZFyE4+C78e9HG6ziQ28wj7VGOFnHveimdvT4KlvOepO6/LpDXlVcFAQGLxnOaCe7 FYwLPYXIdfRLIMUT4O4dQdAtcLXUb09dVRX7hc0M2DiX63diBRm5DQlMAWiil9Etsqm+ lJkJHi1h2Xbm7wIqZTcxMrD3gTg1HI9k0h2swZlDVJAap/VDf8KnbF9OVqFzkJeHRTA9 6lbd/IZWvFnggaIsJcF6MLpOPIyunClVDMgJXjQ1xyyqBCODWVPdWpUe9fZwn2HNAacu GGTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QwtFzkNZ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j26si81253ejs.484.2021.03.23.13.43.21; Tue, 23 Mar 2021 13:43:45 -0700 (PDT) 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=@google.com header.s=20161025 header.b=QwtFzkNZ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233676AbhCWUlZ (ORCPT + 99 others); Tue, 23 Mar 2021 16:41:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233580AbhCWUkX (ORCPT ); Tue, 23 Mar 2021 16:40:23 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 628D3C0613E4 for ; Tue, 23 Mar 2021 13:40:19 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id f81so3810182yba.8 for ; Tue, 23 Mar 2021 13:40:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=tNWRsiiEAfetheYG6qtDYdd6Zu2YM8DJGmENfE26Aac=; b=QwtFzkNZ0ArdJ22uiNb1llxuSobP5aVQNzwPksMPm+yXD4iJErHZlbeYgNVneIsCaV eWzSIifLKq9OeR/urLV+kBUy5t9Lj6BMjZqFICzYH6wVYLJimy4yOQuD7NgKMnmibW9S zG50zFIIhTS3dotn12D1Zy6qsSjg8WUhwZTAAq2J7W9gn7luxZShIQYCTr+CZA3deHb8 U3jjpaLWT8ZiETFcnxTTPxy7Im1JnVTxQxGpi3yBHzfY2Dfw3S61ouZ35+FlKNnKAFPT AeZpguEmKCpHpboafyAslh+3UWQD/2MhlgpX4aQM7wK4y4d9OGGiM9NT5wh5PIZuoCtX 4HRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=tNWRsiiEAfetheYG6qtDYdd6Zu2YM8DJGmENfE26Aac=; b=hDGLSew7CfojBeG8DGsRaOoftXhfC/Dw2RmStfupKVoL8gDOK8AD9Pwa0kKG5KvcUu FPVNgsm3TePUN67mnf/zRZqP4Oy8anMwwKjPce4IKUsmCgtg5axrbyUMEkzaQhVyhaHC D/XrIxglocGxVNFcP+l1ISxeqQes+Lu+2EGDcdh6NIcqdvlHJsVm7V75qXWQnSi6VEae lM+W/FBEvI3WKa5aKh54it3VkPmEf1cJWNxdHP2WNNpuHBzqBdxIYVjfa55mF1OJC1/v uAVqAnN4Oz2Qn0vi7o2Tgoeh/G/thEo5bMcw+L6XQf/DBmVgtUzGzrlK4yBeAnCalHuO FEWA== X-Gm-Message-State: AOAM5338smTqnmam1v57Sw95UFVsdpZy7XAkVqR22fDl6LmmLBnOjAJZ KOFywoGe0SVfDlqe75LVhS33nGBSVDSGZlgv3zc= X-Received: from samitolvanen1.mtv.corp.google.com ([2620:15c:201:2:e9a3:260d:763b:67dc]) (user=samitolvanen job=sendgmr) by 2002:a25:686:: with SMTP id 128mr110596ybg.258.1616532018575; Tue, 23 Mar 2021 13:40:18 -0700 (PDT) Date: Tue, 23 Mar 2021 13:39:45 -0700 In-Reply-To: <20210323203946.2159693-1-samitolvanen@google.com> Message-Id: <20210323203946.2159693-17-samitolvanen@google.com> Mime-Version: 1.0 References: <20210323203946.2159693-1-samitolvanen@google.com> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog Subject: [PATCH v3 16/17] KVM: arm64: Disable CFI for nVHE From: Sami Tolvanen To: Kees Cook Cc: Nathan Chancellor , Nick Desaulniers , Masahiro Yamada , Will Deacon , Jessica Yu , Arnd Bergmann , Tejun Heo , "Paul E. McKenney" , Christoph Hellwig , Peter Zijlstra , 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, Sami Tolvanen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Disable CFI for the nVHE code to avoid address space confusion. Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook --- arch/arm64/kvm/hyp/nvhe/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/Makefile b/arch/arm64/kvm/hyp/nvhe/Makefile index a6707df4f6c0..fb24a0f022ad 100644 --- a/arch/arm64/kvm/hyp/nvhe/Makefile +++ b/arch/arm64/kvm/hyp/nvhe/Makefile @@ -75,9 +75,9 @@ quiet_cmd_hyprel = HYPREL $@ quiet_cmd_hypcopy = HYPCOPY $@ cmd_hypcopy = $(OBJCOPY) --prefix-symbols=__kvm_nvhe_ $< $@ -# Remove ftrace and Shadow Call Stack CFLAGS. -# This is equivalent to the 'notrace' and '__noscs' annotations. -KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS), $(KBUILD_CFLAGS)) +# Remove ftrace, Shadow Call Stack, and CFI CFLAGS. +# This is equivalent to the 'notrace', '__noscs', and '__nocfi' annotations. +KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) $(CC_FLAGS_CFI), $(KBUILD_CFLAGS)) # KVM nVHE code is run at a different exception code with a different map, so # compiler instrumentation that inserts callbacks or checks into the code may -- 2.31.0.291.g576ba9dcdaf-goog