Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2530526pxa; Mon, 24 Aug 2020 17:32:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVU6Nn9soczkU4JiVJfXkudq9oxmnFgc+viZISkNFc8+jzclL7AVZHhw++SkFWn5uLpHmq X-Received: by 2002:a05:6402:748:: with SMTP id p8mr8159974edy.305.1598315552806; Mon, 24 Aug 2020 17:32:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598315552; cv=none; d=google.com; s=arc-20160816; b=XMN3DScD9DXPcY0ZBdUylrRto10QPV6qggEoLqO34wyRc8LpWMco52aBiSj2lPfRf3 TQHRFK8jQOjqKNa8VrkVw4e1/Dc3oo/Pd7z9RyuCFqm3ewEW9AZrEF8yVmZTjxVtqQNB edm3cej5LFgSGFLFLquHLrhx6UsPB8GC8iRXNd8QEgIhNXssbfPq2W8yQLBxDM1722mk cWu6FPjYugOW0PSn8Mg5yDa58dFqYB2aoxhDMbXvqE0ODdkz9si2n76ErRq1Jvt6M1y7 dgqoC3eMLIw6GV+AH8VHUbcpUFOmRItT5Aqpi8MHd1MHG+DAmD019ccuSrxQiswRupIu 7PVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=fRnqEz/x60X7aIxcx67EOthFQMpJx3HRnYaC64CTWGQ=; b=ZbVMZrvKPmX6O4g7Vx4s2m8wXFH5eV2443JmZXwBfiIG6PM3fO6RaCx+KLpNzbtbNT /C6s4nSjIY6ogO5fKFmhtD7os8rEc/GqQPPR2h/y/wScxlVq3mHQKVUagAi36dr9TOcl 2a97aEE5GF+JYgdlN5kmFrsZLnIFrA/G8tKJ+6ez4qyRjmBcglyPoSyIuEVVGH4XnhY8 MbFg6fYlkLFmhUMBLxwyqptSgHVLPWpSN2333rqFzP5QqbT9qXKXEpCaXXMLTY8gnLGU mD3egWYNICybL6H9+10qh/c3nxwLzVsklpRPYI+3TfOkK2klY4X6lC+ftCDiXkiW0H6p 3OrA== 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 k25si7685990ejx.608.2020.08.24.17.32.10; Mon, 24 Aug 2020 17:32:32 -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 S1728553AbgHYAbA (ORCPT + 99 others); Mon, 24 Aug 2020 20:31:00 -0400 Received: from mga01.intel.com ([192.55.52.88]:28753 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728493AbgHYAal (ORCPT ); Mon, 24 Aug 2020 20:30:41 -0400 IronPort-SDR: ETmAT1ntNHezUodsKD7XAV2LpICu/LpT1466kZAuiasOzkusvrtv4nKzxLtSsA1DJ9FtcbQKwN ps+IRviKGNgQ== X-IronPort-AV: E=McAfee;i="6000,8403,9723"; a="174053294" X-IronPort-AV: E=Sophos;i="5.76,350,1592895600"; d="scan'208";a="174053294" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2020 17:30:38 -0700 IronPort-SDR: lYjt4wcfMve2UloFv1ZVhYpn9TLEcoQGsrogMIRpRCyCUOWZ2cXw36gxsL2insLMn2J+uDtF9n 2Af6Rj+f0Ywg== X-IronPort-AV: E=Sophos;i="5.76,350,1592895600"; d="scan'208";a="443429341" Received: from yyu32-desk.sc.intel.com ([143.183.136.146]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2020 17:30:37 -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 Cc: Yu-cheng Yu Subject: [PATCH v11 9/9] x86: Disallow vsyscall emulation when CET is enabled Date: Mon, 24 Aug 2020 17:26:44 -0700 Message-Id: <20200825002645.3658-10-yu-cheng.yu@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200825002645.3658-1-yu-cheng.yu@intel.com> References: <20200825002645.3658-1-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "H.J. Lu" Emulation of the legacy vsyscall page is required by some programs built before 2013. Newer programs after 2013 don't use it. Disallow vsyscall emulation when Control-flow Enforcement (CET) is enabled to enhance security. Signed-off-by: H.J. Lu Signed-off-by: Yu-cheng Yu --- arch/x86/Kconfig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 5bd6d6a10047..bbc68ecfae2b 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1210,7 +1210,7 @@ config X86_ESPFIX64 config X86_VSYSCALL_EMULATION bool "Enable vsyscall emulation" if EXPERT default y - depends on X86_64 + depends on X86_64 && !X86_INTEL_CET help This enables emulation of the legacy vsyscall page. Disabling it is roughly equivalent to booting with vsyscall=none, except @@ -1225,6 +1225,8 @@ config X86_VSYSCALL_EMULATION Disabling this option saves about 7K of kernel size and possibly 4K of additional runtime pagetable memory. + This option is disabled when Intel CET is enabled. + config X86_IOPL_IOPERM bool "IOPERM and IOPL Emulation" default y @@ -2361,7 +2363,7 @@ config COMPAT_VDSO choice prompt "vsyscall table for legacy applications" - depends on X86_64 + depends on X86_64 && !X86_INTEL_CET default LEGACY_VSYSCALL_XONLY help Legacy user code that does not know how to find the vDSO expects @@ -2378,6 +2380,8 @@ choice If unsure, select "Emulate execution only". + This option is not enabled when Intel CET is enabled. + config LEGACY_VSYSCALL_EMULATE bool "Full emulation" help -- 2.21.0