Message ID | 20230319001535.23210-37-rick.p.edgecombe@intel.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62E4BC761A6 for <linux-mm@archiver.kernel.org>; Sun, 19 Mar 2023 00:16:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 77BEC280023; Sat, 18 Mar 2023 20:16:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 61749280001; Sat, 18 Mar 2023 20:16:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 41B71280023; Sat, 18 Mar 2023 20:16:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 29AF6280001 for <linux-mm@kvack.org>; Sat, 18 Mar 2023 20:16:58 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 01F4880CAF for <linux-mm@kvack.org>; Sun, 19 Mar 2023 00:16:58 +0000 (UTC) X-FDA: 80583732516.27.3660E1B Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf26.hostedemail.com (Postfix) with ESMTP id 21C0C140003 for <linux-mm@kvack.org>; Sun, 19 Mar 2023 00:16:55 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=i6l+xyb8; spf=pass (imf26.hostedemail.com: domain of rick.p.edgecombe@intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=rick.p.edgecombe@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679185016; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references:dkim-signature; bh=gQxmIVCDyiXNijRz9GDbHj/9hmkObe8BeLOXxhdnjvY=; b=rTkW2cbXYg/7wo/hwMaVQad7heNUDD8hU3GAveXr2xASU7JDbeyBwGk/zsLvxm2GIXzG8O hgRexB8sBMrwhe5BNLcXCZ6Cn021R/Fou1TmHApLwvYm5EiYa1sD1zd72CpyWKlzCj3wfS op/iadLt6/Q6bXGQRCgsa7AyhmxYa98= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=i6l+xyb8; spf=pass (imf26.hostedemail.com: domain of rick.p.edgecombe@intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=rick.p.edgecombe@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679185016; a=rsa-sha256; cv=none; b=D6NQjKzbgc76MxeywXtv7eX1d3z+MXfEUI48sGCExy7nxpb1i0/MTXBv9tRzPW/0OnDYaQ KxEFBhjhq04x3GZBzi//5wfnxmwWfjLLavydPrZsWW7MIozkdSshcxH3GXHg0dGU3BElsR 5w3pSiDeLbKjoMsAfDPoT13RQKZiczs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679185016; x=1710721016; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=XWhd33s80bJV+B2OfEZjFLW5DvuhEuOlL0wc6R5POX8=; b=i6l+xyb8qVDiWcZq04Z/9eBXOqgBwnIqYkzpC3izi7cMBI2XG5j4g2vD g13O4gZAdjJT27lun1L/dQM37tTdMg+NZL4+N5UTjbX/X4CdIEbBZ83vs b/ziaq+gdswhQs2qZ7I/BVxxnRfTpAoOAcRkllsMNJf5GCIf1+6uIAKtk jNrCc8/VRL8v9ThmIzQ1vV1WX9c1ri5oU2r4AsTtlBeVWCvAWq4FQptdP QiDNgSUhKN1FKDs9aZDUtVav1Dzt5nAAl0M5hkg+0SBLUqRtblSXe/wFt QCF9t4jMyYl11BPbpHWBF8egI9CawUGe8yxdlsJy8whpRGVMStJ7wScxy w==; X-IronPort-AV: E=McAfee;i="6600,9927,10653"; a="338491547" X-IronPort-AV: E=Sophos;i="5.98,272,1673942400"; d="scan'208";a="338491547" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2023 17:16:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10653"; a="749672989" X-IronPort-AV: E=Sophos;i="5.98,272,1673942400"; d="scan'208";a="749672989" Received: from bmahatwo-mobl1.gar.corp.intel.com (HELO rpedgeco-desk.amr.corp.intel.com) ([10.135.34.5]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2023 17:16:53 -0700 From: Rick Edgecombe <rick.p.edgecombe@intel.com> To: x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, 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 <arnd@arndb.de>, Andy Lutomirski <luto@kernel.org>, Balbir Singh <bsingharora@gmail.com>, Borislav Petkov <bp@alien8.de>, Cyrill Gorcunov <gorcunov@gmail.com>, Dave Hansen <dave.hansen@linux.intel.com>, Eugene Syromiatnikov <esyr@redhat.com>, Florian Weimer <fweimer@redhat.com>, "H . J . Lu" <hjl.tools@gmail.com>, Jann Horn <jannh@google.com>, Jonathan Corbet <corbet@lwn.net>, Kees Cook <keescook@chromium.org>, Mike Kravetz <mike.kravetz@oracle.com>, Nadav Amit <nadav.amit@gmail.com>, Oleg Nesterov <oleg@redhat.com>, Pavel Machek <pavel@ucw.cz>, Peter Zijlstra <peterz@infradead.org>, Randy Dunlap <rdunlap@infradead.org>, Weijiang Yang <weijiang.yang@intel.com>, "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>, John Allen <john.allen@amd.com>, kcc@google.com, eranian@google.com, rppt@kernel.org, jamorris@linux.microsoft.com, dethoma@microsoft.com, akpm@linux-foundation.org, Andrew.Cooper3@citrix.com, christina.schimpe@intel.com, david@redhat.com, debug@rivosinc.com, szabolcs.nagy@arm.com Cc: rick.p.edgecombe@intel.com Subject: [PATCH v8 36/40] x86/shstk: Wire in shadow stack interface Date: Sat, 18 Mar 2023 17:15:31 -0700 Message-Id: <20230319001535.23210-37-rick.p.edgecombe@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230319001535.23210-1-rick.p.edgecombe@intel.com> References: <20230319001535.23210-1-rick.p.edgecombe@intel.com> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 21C0C140003 X-Stat-Signature: qo49hcc5jqjjuzyr6ddhwtexwymx1ycz X-Rspam-User: X-HE-Tag: 1679185015-168953 X-HE-Meta: U2FsdGVkX1/0SQ54oO6zNrTGp6FqQqIUd6z7r14e4sQxNm+sCZ2gBDPV8hVsJWvZ/tapSlXEaOMYo2lSyUrDsQiNXd/Vw7bYkRw2uZOw3LIjXQgJadDYx7kAIsrqPz4MdhWvCBu/OrwaLwYMTp4Z8M13kAYFA3RjZ2AVVaF47R9PvB8Fj8aBzjP7uSd7s9V0qmH+NXbzgSoxN53V07Oj7wAyyHiJJnbx7fQPuViBkhITZeeorXbcrwHekRGM0VD+l46MRmTNKCzZSE9C5PNZ5qJqJc2UtTU/lXqTsrxFzlyueqw6D6vNkxh/vYcqHJrT3QWdYoB8rE7IG60VPsbgokBM0peCmLVHS3zZKlfGFOZSql4pjKvaytLrG3G94UsrFkCQO8GJWl7a5nkIwuFLavB3/wCl7SmmEVu4GNUDp1MLuRxV/9fN04a/eGTehrvOEknubZElEoTcfCSM8oGjaNBzCQ3esv/teumLwl6GhgfslFIu0in5YjC0bp/MX1fAXzbMBt1FDpjUTAcs4/toixLGvqiaPs36ZNofp+VhBzsIBR45GpE0HAHAg9dRUvRxnoQiBBKCK2zV4VhOEXXXs3mRQ/jLTAYlQZWp0ad68hOSrZ/OsA300IXdNicw+wt7YnKXgVxNeMONY37QiWaUumJO/I8qOhnJGP2Shl+jSWWpqS0BQLgRE0UP4E+NkIY4oX3pdhZ7QJiEVdPixglbQ6Z1CHVhmRKZlc1GffUkscXKEhT3oeRmsqCgUvMM3a5oJDq5M2bOQE+v3yd090RxMwpGohC+cpZvXxfOpYMbLlR7wrJrl4CLo2D6ptkr/PdGxE/i5xR+XiXUSV4pfxF7H4l2h3/81BuTuVqo9zSwYTgBe5zHXAUuMwbz7DTlQ8d+OoM9csX5b4Xmd2gFhvJpnIiv5kijxs1Ksm9T2k/ZOqpSfxZI5w+E7tigeQS2T0ujF0g5Ckc3LRiy46L0qJT MjinZQ4f xc0DARnPnr89IOolzKR+D7zMLMyzdeow73oLUulS4IK2OnpOno40Sl4Zk1ctB5dcv7ipvVgdc32t57LTvWoZxcJ39LVd1vaUKszmwhOjf/hdQ5yEGAAX62NRIeHLdr/m7hVXMGjeyEK6vQABMMswf9EEq2xJl7Pz0U6FEVyiEifTpS5MV2pECAemReBPnx/R1S5dbe57nlZimfgTVlK4tO6qI3++aJtXJvhO5FCyJHu6DUKU09i/3mCgLzUBRGsp4ZxM3SW+xOrzbXr++EODDxKyHhXMy3vF/SQw4cmOtM8Lofsd9PN8y2IUkWmERTit0ol7ctIM3Qo5gR62EbWlGNNGIsvyNvdYBo0yV X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Shadow stacks for userspace
|
expand
|
diff --git a/arch/x86/kernel/shstk.c b/arch/x86/kernel/shstk.c index 01b45666f1b6..ee89c4206ac9 100644 --- a/arch/x86/kernel/shstk.c +++ b/arch/x86/kernel/shstk.c @@ -472,9 +472,17 @@ long shstk_prctl(struct task_struct *task, int option, unsigned long features) return -EINVAL; if (option == ARCH_SHSTK_DISABLE) { + if (features & ARCH_SHSTK_WRSS) + return wrss_control(false); + if (features & ARCH_SHSTK_SHSTK) + return shstk_disable(); return -EINVAL; } /* Handle ARCH_SHSTK_ENABLE */ + if (features & ARCH_SHSTK_SHSTK) + return shstk_setup(); + if (features & ARCH_SHSTK_WRSS) + return wrss_control(true); return -EINVAL; }