Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp850579pxv; Thu, 22 Jul 2021 14:00:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+VUthBN51Lc4XmdTo2DdNf13BtD1NZTq1l+aZUsRYA67lcPABuSmOGyHz+IvQRtPQuz6H X-Received: by 2002:a02:a38f:: with SMTP id y15mr1299250jak.108.1626987651103; Thu, 22 Jul 2021 14:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626987651; cv=none; d=google.com; s=arc-20160816; b=RTRCTXRjY8+LOqjVpIxsGpVLuK6I4NPvvJUwoIoB13/d7DK/NrS80Gv//wfOmVDRSc 4E/2D61lw4aOwuwTFj9H0ivScw47CgyVpLkvCsqGezpfyKI8QrJpp+cjGoJl9NMqHjT1 By0HDnr6DMTUlq8A16OrKUr/hy4s0UTdjP31q/JWBd2FiN44kCOe/GluMAUtjjZ+zWiI ZyAqtSJECwCiuEnhw+CJSLuPohJe+AVABfl7EBDHLmlLDPYeCvNQKZ2W+SGA0tECccnF KXalbulruS3cBcGuAJStsPXPxo5WhsMJlDkEg9nZ9Da7uOnGVjU6soaB4XFevESV9VNM wCYw== 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=knmGoygFrDnaAW/oBCGTRjSv57evVf7eZdUl+esexrGx2M9i20ppmGeZwJ2BxQ+nAL 63OE9E1j/uHkfGer4lmpFkn8psD4UMbkQ8//iOti49AuJEulbzEGdWsAObxKU90HaWrG 2kGdVWg4OByT9//0ioSzTJn0DTjANZeok62wpLnkJoeR7Qn5xkBEW3bHIPUOsA0fB1L6 NZHEpJmHzHsufeO42Js5FY+5U+Rg5cCcb3yDvbVKhyOAnIUN7wsGjt1UaAAXtegmhGE/ DuG1lf6dKZvMD4YzbS1ogF8KQTFSMPJNcXzKwDYA/ZvTJh5ja/XAVs3M3imuvNCFHdk2 4JgQ== 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 q5si23612551ilt.55.2021.07.22.14.00.38; Thu, 22 Jul 2021 14:00:51 -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 S232154AbhGVUR5 (ORCPT + 99 others); Thu, 22 Jul 2021 16:17:57 -0400 Received: from mga07.intel.com ([134.134.136.100]:54788 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231400AbhGVURc (ORCPT ); Thu, 22 Jul 2021 16:17:32 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10053"; a="275561726" X-IronPort-AV: E=Sophos;i="5.84,262,1620716400"; d="scan'208";a="275561726" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2021 13:58:06 -0700 X-IronPort-AV: E=Sophos;i="5.84,262,1620716400"; d="scan'208";a="433273386" Received: from yyu32-desk.sc.intel.com ([143.183.136.146]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2021 13:58:05 -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 v28 09/10] x86/vdso/32: Add ENDBR to __kernel_vsyscall entry point Date: Thu, 22 Jul 2021 13:57:22 -0700 Message-Id: <20210722205723.9476-10-yu-cheng.yu@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210722205723.9476-1-yu-cheng.yu@intel.com> References: <20210722205723.9476-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