Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4834062pxy; Tue, 27 Apr 2021 13:50:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqL+bDPq/ZlxmrcuxUSekcvk/8IMu5cjdpxVtMJQ2lIQx8abOBvS5m1HCfonXNpZFCIoHh X-Received: by 2002:a17:90b:2291:: with SMTP id kx17mr28597863pjb.79.1619556622551; Tue, 27 Apr 2021 13:50:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619556622; cv=none; d=google.com; s=arc-20160816; b=zgbp3dTTsLAhyVmraGkczWUW26aXVCvC4IfkOdraTistT4/NxXB13ZsqArS5g8VCVf MJIYVzabzfcyvZUhvreY75jMPYJSSw7yaoYImQruXJV1hzRPLlgBtQ6D/owUV3J7+J/v G8CSvsFpZ+TxCIUtT4s5EC2gPwSxKVkYGXDc9JkmUjgq/kPWZCaiGPIYSxFbrw5fjeK/ erswEaJjZo0stOAh0UZXV7x24354aPlfa050fB8TXl3KgJHYBSd8ZSJSSu0w/BUAumAe RlRScv+SOQY+k6mOUmOq54/2wkh+0TrgmfmxVsluAmcfozOlVfbRFfzEa4Skraf5YmQJ HeFg== 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 :ironport-sdr:ironport-sdr; bh=wTFRxLlvnE4zE/yZc4ol2GkhNXDnfeRG+8GFjURFS4M=; b=EmDmwlRAcvs3OF4y+Et4SM2j5VE725/Gn/v0rT7JbrWshSv2ROBHL4OrkA41l1d+kg 9EKiMtrKrVrHN9rferPATCFp6Zb46ct3Tv5jgvsROaH3C/aCSouKI/boYHsJC1NVdNFX ejfXvgsgP0X9Tf6RGJTL0YPeTszDL3p54VPr5eZyW92h04rkj1FYXKbWRxq4X0SO1T0/ st1qDMglVxZFM6K1/jIDyzvhlYHGdL4kRc68n+l5K+SwN46R7otUTg36poMeHom2WLhz SJ+7mBabZ7jJrJzTqMW+ExAgaRpM5CAGCgPEjU5L2jkHiTaBwHbbXZywoCBk1JTcM73B /oFw== 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 iq22si4319510pjb.25.2021.04.27.13.50.10; Tue, 27 Apr 2021 13:50:22 -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 S239303AbhD0UtV (ORCPT + 99 others); Tue, 27 Apr 2021 16:49:21 -0400 Received: from mga09.intel.com ([134.134.136.24]:56333 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239025AbhD0Us5 (ORCPT ); Tue, 27 Apr 2021 16:48:57 -0400 IronPort-SDR: 9rolKg2fL0K7Wgy/kXW7gklaZiiXFjtKb+KbQgBM5Y+oHOtfPOAJxwRYwJyiidFetQG258YH8f GJXioI17faFg== X-IronPort-AV: E=McAfee;i="6200,9189,9967"; a="196699398" X-IronPort-AV: E=Sophos;i="5.82,255,1613462400"; d="scan'208";a="196699398" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2021 13:47:48 -0700 IronPort-SDR: 8rwmVxob87MFnYMGci4MqzN6p43z90fNrub2zRTOn+yu0gU6omgeVk3BQBIp++OvQVjKbxddHk 6T6o4mX250ng== X-IronPort-AV: E=Sophos;i="5.82,255,1613462400"; d="scan'208";a="457835105" Received: from yyu32-desk.sc.intel.com ([143.183.136.146]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2021 13:47:48 -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" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang , Pengfei Xu , Haitao Huang Cc: Yu-cheng Yu Subject: [PATCH v26 8/9] x86/vdso/32: Add ENDBR to __kernel_vsyscall entry point Date: Tue, 27 Apr 2021 13:47:19 -0700 Message-Id: <20210427204720.25007-9-yu-cheng.yu@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210427204720.25007-1-yu-cheng.yu@intel.com> References: <20210427204720.25007-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 Cc: Andy Lutomirski Cc: Kees Cook --- 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 de1fff7188aa..7793dc221726 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