Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1690568pxb; Fri, 20 Aug 2021 11:25:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmKYTtvTuZoIKUC3o+bXqWmjRHCwhjAAJ8ytHCw54kcZtAlwMPTRmIpClG1NHFXLDvdd9R X-Received: by 2002:a6b:296:: with SMTP id 144mr17004093ioc.114.1629483930842; Fri, 20 Aug 2021 11:25:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629483930; cv=none; d=google.com; s=arc-20160816; b=TcYBUN/a4nSSoNeGyajHxvCpLWB8EhMCcE/gIMzSf/eVJXrD1hNOkVkW84apxKBrZS BuaC6EnLGSJNUWBJo+t8jqQVFRYzy+kZAdBelN1Qo1Pa7Ke6ZZ2ilKWcyet85l2N9XRz utVxmdn9o3vSaMkpTximhkwEAPhtd2Jn3kPp9ZeWZYLKuho3bqtD1SNhxHL8Py6uPYIm xx1Lxtg8is/6rjz84+rcgn2sg7LQppEQ7queJFp4phd+A4GKYKZMIVb1R6pjLJqHMn+4 rrGddsZZtIwrJEB5kd1A9n78BDVmDJrIN5dCRDhcuDJGnLcl2PXq4BIWgzDLlIMI4xNG Sacg== 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=C3JTLuhaEmcNaKb0cAGJJ6fB4rAsbd0jbg+vNB6vky4=; b=oUbnguIzsiEj2wbn0KqLcPBJrvDZuujdedCzI64GUYc9AO+VgKlMqwMSbYIvmPXo33 Wymdc1r/kfSqzkgji+6lCojPopQhUkAGjbEU4hA2c+efVmh2/eOqes1VV+M5Z+Tku6KI 4+hZ2LbVhLAnVCD0nJOAr2ghPsCKaJ6WmiXTfeNOXswi8A1YfvXP+/EBGfiN9jFeYFl+ 0Cs99iByv6MLurfkkegOwB0xF/k8HEK8VVJQebwh43skeJ+FL9Fwuwdi0S+d8f8a0Xnh Vcjxrb7yiT/eY/8MJiGZjbkUsmtiociRqR22DCKIRZfCdLO4EtO/wKndIA0L8+y2zN+s E4dQ== 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 x10si3668060ilg.50.2021.08.20.11.25.19; Fri, 20 Aug 2021 11:25:30 -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 S239494AbhHTSY4 (ORCPT + 99 others); Fri, 20 Aug 2021 14:24:56 -0400 Received: from mga18.intel.com ([134.134.136.126]:48048 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238069AbhHTSYa (ORCPT ); Fri, 20 Aug 2021 14:24:30 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10082"; a="203964968" X-IronPort-AV: E=Sophos;i="5.84,338,1620716400"; d="scan'208";a="203964968" 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="523799181" 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 09/10] x86/vdso/32: Add ENDBR to __kernel_vsyscall entry point Date: Fri, 20 Aug 2021 11:22:44 -0700 Message-Id: <20210820182245.1188-10-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" ENDBR is a special new instruction for the Indirect Branch Tracking (IBT) component of CET. IBT prevents attacks by ensuring that (most) indirect branches and function calls may only land at ENDBR instructions. Branches that don't follow the rules will result in control flow (#CF) exceptions. ENDBR is a noop when IBT is unsupported or disabled. Most ENDBR instructions are inserted automatically by the compiler, but branch targets written in assembly must have ENDBR added manually. Add that to __kernel_vsyscall entry point. Signed-off-by: H.J. Lu Signed-off-by: Yu-cheng Yu Reviewed-by: Kees Cook Cc: Andy Lutomirski --- arch/x86/entry/vdso/vdso32/system_call.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/entry/vdso/vdso32/system_call.S b/arch/x86/entry/vdso/vdso32/system_call.S index 6ddd7a937b3e..d321c2ded33a 100644 --- a/arch/x86/entry/vdso/vdso32/system_call.S +++ b/arch/x86/entry/vdso/vdso32/system_call.S @@ -7,6 +7,7 @@ #include #include #include +#include .text .globl __kernel_vsyscall @@ -14,6 +15,7 @@ ALIGN __kernel_vsyscall: CFI_STARTPROC + ENDBR32 /* * Reshuffle regs so that all of any of the entry instructions * will preserve enough state. -- 2.21.0