Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1691120pxb; Fri, 20 Aug 2021 11:26:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMdjbtFMCFh923sL8onTEwPW6vRq74lEIu0rZtg7SA+YFLZseNoCiIS4yV33GLIUD2AQ1a X-Received: by 2002:aa7:d2cd:: with SMTP id k13mr23521775edr.0.1629483991352; Fri, 20 Aug 2021 11:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629483991; cv=none; d=google.com; s=arc-20160816; b=MPzoe+QQqLHeV8/fGn3tBqukLiY1E2Jffn5h2bilzlKpMFptdxQoWJBgKOWNo2cZxr +rMOupefiCn8R+gbn2BnRbnc7g1hiQaRMg6Up/L/4TvLhfEINBasozLXUcPM16bGxuwI +UcqOIjBS6Q3iPQ9EoaEabAxzGTMEL4joAFwgWziLwh/enRKN+8la3qvmZcLBHiNq4TL JTk8Eiigx96qtj5IqXjE1ZyNY+GGF9hXV0z5NmeO1xXT/IgXjbEbZJRD4a2bcgRksFvC MryPEwruniQVceXBXrpNhInJP1BJE5TX76wU+l1MHAKv0cGrvoE0HiG9z4l1QA3x5mjI lYMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=tqYZ08muLN97IPRBMjMkj4hR3IT9dH31MerN/Dn1Zmw=; b=DCk6LvaVmJgnRwbAQoI4aQafaqUBTBfxN4Cpnoaenuhyh4uIFZ4HCtcpXzeWYK0oNm /VDUz59SApPt0D3TCCaM+AI9YiGHJuwH+IgY3miDYmPzwvl4gWFyJE8UAyP5DlRemau1 xLwcEuzokJk2JxETP775u8z+qNZ0A7evtnsD+EMp6ETVuaOJ9aasE4EulZ3jqdtL2iS7 YvgKIWQHu3LsOy6p7e7gkl+ygyvdV9kh6K/KseyqBYoXoqAUUGMzb7fYrqOkgL9rYKHX pqiRAsKNvcVDkP68ZWPwwRrbkr3ylWsRRGP+CnrK6Vg1brQYY05r46zlQsfGR52TD+pW DVkw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t9si7028866ejj.606.2021.08.20.11.26.06; Fri, 20 Aug 2021 11:26:31 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235793AbhHTSYt (ORCPT + 99 others); Fri, 20 Aug 2021 14:24:49 -0400 Received: from mga18.intel.com ([134.134.136.126]:48046 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238756AbhHTSYX (ORCPT ); Fri, 20 Aug 2021 14:24:23 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10082"; a="203964960" X-IronPort-AV: E=Sophos;i="5.84,338,1620716400"; d="scan'208";a="203964960" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2021 11:23:09 -0700 X-IronPort-AV: E=Sophos;i="5.84,338,1620716400"; d="scan'208";a="523799174" Received: from yyu32-desk.sc.intel.com ([143.183.136.146]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2021 11:23:09 -0700 From: Yu-cheng Yu To: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Dave Martin , Weijiang Yang , Pengfei Xu , Haitao Huang , Rick P Edgecombe Cc: Yu-cheng Yu Subject: [PATCH v29 07/10] x86/vdso: Insert endbr32/endbr64 to vDSO Date: Fri, 20 Aug 2021 11:22:42 -0700 Message-Id: <20210820182245.1188-8-yu-cheng.yu@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210820182245.1188-1-yu-cheng.yu@intel.com> References: <20210820182245.1188-1-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "H.J. Lu" When Indirect Branch Tracking (IBT) is enabled, vDSO entry points need ENDBR32/ENDBR64 as first instructions. Kconfig X86_IBT verifies compiler's -fcf-protection support. Update vDso Makefile to enable it. Signed-off-by: H.J. Lu Signed-off-by: Yu-cheng Yu Reviewed-by: Kees Cook Cc: Andy Lutomirski --- arch/x86/entry/vdso/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile index 05c4abc2fdfd..a773a5f03b63 100644 --- a/arch/x86/entry/vdso/Makefile +++ b/arch/x86/entry/vdso/Makefile @@ -93,6 +93,10 @@ endif $(vobjs): KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO) $(GCC_PLUGINS_CFLAGS) $(RETPOLINE_CFLAGS),$(KBUILD_CFLAGS)) $(CFL) +ifdef CONFIG_X86_IBT +$(vobjs) $(vobjs32): KBUILD_CFLAGS += -fcf-protection=branch +endif + # # vDSO code runs in userspace and -pg doesn't help with profiling anyway. # -- 2.21.0